|
|
|
|
|
|
|
|
{% from "network/defaults.yaml" import rawmap with context %} |
|
|
{% from "network/defaults.yaml" import rawmap with context %} |
|
|
{% set datamap = salt['grains.filter_by'](rawmap, merge=salt['pillar.get']('network:lookup')) %} |
|
|
{% set datamap = salt['grains.filter_by'](rawmap, merge=salt['pillar.get']('network:lookup')) %} |
|
|
|
|
|
|
|
|
{% set hosts = datamap['hosts']['def_entries'] %} |
|
|
|
|
|
|
|
|
{% set hosts = datamap.hosts.def_entries %} |
|
|
|
|
|
|
|
|
{% if salt['pillar.get']('network:hosts', False) %} |
|
|
{% if salt['pillar.get']('network:hosts', False) %} |
|
|
{% set hosts = hosts + salt['pillar.get']('network:hosts') %} |
|
|
{% set hosts = hosts + salt['pillar.get']('network:hosts') %} |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
|
|
|
|
|
|
{% for h in hosts %} |
|
|
{% for h in hosts %} |
|
|
host-{{ h['name'] }}_{{ h['ip'] }}: |
|
|
|
|
|
|
|
|
host_{{ h.name }}_{{ h.ip }}: |
|
|
host: |
|
|
host: |
|
|
- {{ h['ensure']|default(datamap['hosts']['values']['ensure']) }} |
|
|
|
|
|
- ip: {{ h['ip'] }} |
|
|
|
|
|
- name: {{ h['name'] }} |
|
|
|
|
|
|
|
|
- {{ h.ensure|default('present') }} |
|
|
|
|
|
- ip: {{ h.ip }} |
|
|
|
|
|
- name: {{ h.name }} |
|
|
{% endfor %} |
|
|
{% endfor %} |