Bechtoldt's Network Saltstack Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 11 година
пре 11 година
пре 11 година
пре 11 година
12345678910111213141516
  1. {% from "network/defaults.yaml" import rawmap with context %}
  2. {% set datamap = salt['grains.filter_by'](rawmap, merge=salt['pillar.get']('network:lookup')) %}
  3. {% set hosts = datamap.hosts.def_entries %}
  4. {% if salt['pillar.get']('network:hosts', False) %}
  5. {% set hosts = hosts + salt['pillar.get']('network:hosts') %}
  6. {% endif %}
  7. {% for h in hosts %}
  8. host_{{ h.name }}_{{ h.ip }}:
  9. host:
  10. - {{ h.ensure|default('present') }}
  11. - ip: {{ h.ip }}
  12. - name: {{ h.name }}
  13. {% endfor %}