VOL-394 This update ensures that the appropriate directories are created
for consul and that the consul config is copied to one of those
directories.
Change-Id: I3f925f1ee28786fe4f9acdb54bbbe0db6b708857
diff --git a/install/ansible/roles/cluster-host/tasks/main.yml b/install/ansible/roles/cluster-host/tasks/main.yml
index ac1e2e2..17bcd43 100644
--- a/install/ansible/roles/cluster-host/tasks/main.yml
+++ b/install/ansible/roles/cluster-host/tasks/main.yml
@@ -183,23 +183,17 @@
when: target == "cluster"
tags: [cluster_host]
-- name: A directory for the insecure registry data is created
+- name: Directories for voltha processes are created
file:
- path: "{{ target_voltha_dir }}/registry_data"
+ path: "{{ target_voltha_dir }}/{{ item }}"
state: directory
mode: 0755
owner: voltha
group: voltha
- when: target == "cluster"
- tags: [cluster_host]
-
-- name: A directory for consul's data is created
- file:
- path: "{{ target_voltha_dir }}/consul/data"
- state: directory
- mode: 0755
- owner: voltha
- group: voltha
+ with_items:
+ - registry_data
+ - consul/data
+ - consul/config
when: target == "cluster"
tags: [cluster_host]
diff --git a/install/ansible/roles/installer/tasks/main.yml b/install/ansible/roles/installer/tasks/main.yml
index 5f39f16..0b1666e 100644
--- a/install/ansible/roles/installer/tasks/main.yml
+++ b/install/ansible/roles/installer/tasks/main.yml
@@ -28,6 +28,7 @@
- install/get-host-logs.sh
- install/ansible
- compose
+ - consul_config/basic.json
tags: [installer]
- name: Determine if test mode is active
diff --git a/install/ansible/roles/voltha/tasks/main.yml b/install/ansible/roles/voltha/tasks/main.yml
index eba2325..dea4d12 100644
--- a/install/ansible/roles/voltha/tasks/main.yml
+++ b/install/ansible/roles/voltha/tasks/main.yml
@@ -49,6 +49,18 @@
when: target == "cluster"
tags: [voltha]
+- name: Consul config files and directories are copied
+ synchronize:
+ src: "/home/vinstall/basic.json"
+ dest: "{{ target_voltha_dir }}/consul/config"
+ archive: no
+ owner: no
+ perms: no
+ recursive: yes
+ links: yes
+ when: target == "cluster"
+ tags: [voltha]
+
- name: Insecure registry is configured and permitted
synchronize:
src: "/home/vinstall/daemon.json"