From 010941bfb59e9b029a3279d721d0776c3e84867e Mon Sep 17 00:00:00 2001
From: Artyom Bakhtin
Date: Thu, 25 Apr 2019 09:13:12 +0300
Subject: [PATCH] add overlay network parameters
Signed-off-by: Artyom Bakhtin
---
deploy/ansible/roles/iroha-docker/defaults/main.yml | 2 ++
deploy/ansible/roles/iroha-docker/tasks/deploy.yml | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/deploy/ansible/roles/iroha-docker/defaults/main.yml b/deploy/ansible/roles/iroha-docker/defaults/main.yml
index 3dc9d4d4952..b8914949c71 100644
--- a/deploy/ansible/roles/iroha-docker/defaults/main.yml
+++ b/deploy/ansible/roles/iroha-docker/defaults/main.yml
@@ -34,6 +34,8 @@ iroha_deploy_dir: /opt/iroha-deploy
# The network will be created automatically if deploying locally or with `iroha_overlay_network`
# set to `false`
iroha_network_name: iroha-net
+iroha_network_address: '10.10.111.0/24'
+iroha_network_gateway: '10.10.111.1'
# The role is incompatible with Iroha versions below RC2 since keys format has changed.
# Apply the patch (files/old-keys-format.patch) if you need support for previous Iroha versions.
diff --git a/deploy/ansible/roles/iroha-docker/tasks/deploy.yml b/deploy/ansible/roles/iroha-docker/tasks/deploy.yml
index bb35bc7bf0a..f50ac10a833 100644
--- a/deploy/ansible/roles/iroha-docker/tasks/deploy.yml
+++ b/deploy/ansible/roles/iroha-docker/tasks/deploy.yml
@@ -6,7 +6,7 @@
# Attachable overlay network cannot be created with a `docker_network` module
- name: create Docker network
- shell: "docker network create -d overlay --attachable {{ iroha_network_name }} || true"
+ shell: "docker network create -d overlay --attachable {{ iroha_network_name }} --gateway {{ iroha_network_gateway }} --subnet {{ iroha_network_address }} || true"
when: iroha_overlay_network
run_once: yes