aboutsummaryrefslogtreecommitdiffstats
path: root/docker/ansible/roles/config_files/vars
diff options
context:
space:
mode:
Diffstat (limited to 'docker/ansible/roles/config_files/vars')
-rw-r--r--docker/ansible/roles/config_files/vars/main.yml5
1 files changed, 4 insertions, 1 deletions
diff --git a/docker/ansible/roles/config_files/vars/main.yml b/docker/ansible/roles/config_files/vars/main.yml
index 461bfc3f..cbe64b3c 100644
--- a/docker/ansible/roles/config_files/vars/main.yml
+++ b/docker/ansible/roles/config_files/vars/main.yml
@@ -23,7 +23,10 @@ interval_value: 10
#network plugin vars
network_port: 25826
-network_ip_addr: "{{ (groups['influxdb_hosts']|default({}))[0] | default('localhost') }}"
+#get influxdb name as defined in inventory
+influxdb_hostname: "{{ (groups['influxdb_hosts']|default({}))[0] | default('localhost') }}"
+#get hostname as used by ansible
+network_ip_addr: "{{ hostvars[influxdb_hostname].ansible_hostname }}"
#prometheus plugin vars
prometheus_port: 9103