diff options
Diffstat (limited to 'docker/ansible/roles/run_grafana/vars')
-rw-r--r-- | docker/ansible/roles/run_grafana/vars/main.yml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/docker/ansible/roles/run_grafana/vars/main.yml b/docker/ansible/roles/run_grafana/vars/main.yml index 0975b598..eb2d5274 100644 --- a/docker/ansible/roles/run_grafana/vars/main.yml +++ b/docker/ansible/roles/run_grafana/vars/main.yml @@ -13,5 +13,7 @@ # limitations under the License. --- -influxdb_hostname: localhost -influxdb_host_ip: 127.0.0.1 +#get hostname from invetory +influxdb_hostname: "{{ (groups['influxdb_hosts']|default({}))[0] | default('localhost') }}" +#get ip address for given host +influxdb_host_ip: "{{ hostvars[influxdb_hostname].ansible_default_ipv4.address }}" |