aboutsummaryrefslogtreecommitdiffstats
path: root/docker/ansible/roles/config_files/tasks/network.yml
diff options
context:
space:
mode:
authorJohn O Loughlin <john.oloughlin@intel.com>2018-10-23 11:57:19 +0100
committerJohn O'Loughlin <john.oloughlin@intel.com>2018-10-31 10:06:59 +0000
commitd9c7551a005494c025c03b3fd363acb0e5c74f9f (patch)
tree274844f1219fd810fd3b918dd1db8085cbf5d4ca /docker/ansible/roles/config_files/tasks/network.yml
parent3e269c4c295e3dd81dfeaebe9de4c4a702e7f1d5 (diff)
Add support for multi influx hosts
Added support for multiple influx hosts. Fix issue where ansible crashes when influx_host is not defined Change-Id: I348e53c9b6147b0fafffdebcd80037acb72d67ce Signed-off-by: John O Loughlin <john.oloughlin@intel.com>
Diffstat (limited to 'docker/ansible/roles/config_files/tasks/network.yml')
-rw-r--r--docker/ansible/roles/config_files/tasks/network.yml21
1 files changed, 20 insertions, 1 deletions
diff --git a/docker/ansible/roles/config_files/tasks/network.yml b/docker/ansible/roles/config_files/tasks/network.yml
index dca0c235..52902d4c 100644
--- a/docker/ansible/roles/config_files/tasks/network.yml
+++ b/docker/ansible/roles/config_files/tasks/network.yml
@@ -13,9 +13,28 @@
# limitations under the License.
---
-- name: enable network plugin
+- name: Enable network plugin
template:
src: network.conf.j2
dest: "{{ config_file_dir }}/network.conf"
tags:
- network
+
+- name: Add network port if defined
+ lineinfile:
+ dest: "{{ config_file_dir }}/network.conf"
+ insertafter: Plugin network
+ line: " Server \"{{ network_ip_addr }}\" \"{{ network_port }}\""
+ when: network_ip_addr is defined
+ tags:
+ - network
+
+- name: Modify network.conf to add influxdb_hosts
+ lineinfile:
+ dest: "{{ config_file_dir }}/network.conf"
+ insertafter: Plugin network
+ line: " Server \"{{ item }}\" \"{{ influx_network_port }}\""
+ with_items: "{{ groups['influxdb_hosts'] }}"
+ tags:
+ - network
+