commit 3f4e2d95cca5d4ea531c92b3b12d808c338fc6d9 parent 3d4c706f6570b73eafd90b7cce02c6ee371ed0fb Author: Dionysis Grigoropoulos <dgrig@erethon.com> Date: Tue, 29 Oct 2019 00:54:09 +0200 ansible: Add a safe default IP for Prometheus host Diffstat:
ansible/inventory/group_vars/all/ferm.yml | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ansible/inventory/group_vars/all/ferm.yml b/ansible/inventory/group_vars/all/ferm.yml @@ -12,6 +12,6 @@ ferm__rules: table: 'filter' chain: 'INPUT' dport: [ 9100 ] - saddr: "{{ hostvars['prometheus_host'].ansible_host }}" + saddr: "{% if hostvars['prometheus_host'] is defined %} {{ hostvars['prometheus_host'].ansible_host }} {% else %} '127.0.0.1' {% endif %}" protocol: 'tcp' domain: 'ip'