only include extra_hosts if nodestab exists

This commit is contained in:
Doug Burks
2020-10-12 10:13:05 -04:00
committed by GitHub
parent e0fe63d263
commit 553ce3e363

View File

@@ -56,8 +56,8 @@ so-soc:
- /opt/so/conf/soc/soc.json:/opt/sensoroni/sensoroni.json:ro
- /opt/so/conf/soc/changes.json:/opt/sensoroni/html/changes.json:ro
- /opt/so/log/soc/:/opt/sensoroni/logs/:rw
- extra_hosts:
{%- if salt['pillar.get']('nodestab', {}) %}
- extra_hosts:
{%- for SN, SNDATA in salt['pillar.get']('nodestab', {}).items() %}
- {{ SN.split('_')|first }}:{{ SNDATA.ip }}
{%- endfor %}
@@ -125,4 +125,4 @@ soc_state_not_allowed:
test.fail_without_changes:
- name: soc_state_not_allowed
{% endif %}
{% endif %}