Bechtoldt's Network Saltstack Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920212223
  1. #!jinja|yaml
  2. # vim: sts=2 ts=2 sw=2 et ai
  3. #{% from "network/defaults.yaml" import rawmap with context %}
  4. {% set datamap = salt['pillar.get']('network') %}
  5. {% set routes = datamap.routes %}
  6. {% if salt['pillar.get']('network:routes', False) %}
  7. {% for r in routes %}
  8. {{ r.name }}:
  9. network.routes:
  10. - name: {{ r.name }}
  11. - routes:
  12. {% for n in r.networks %}
  13. - name: {{ n.name }}
  14. ipaddr: {{ n.ipaddr }}
  15. netmask: {{ n.netmask }}
  16. gateway: {{ n.gateway }}
  17. {% endfor %}
  18. {% endfor %}
  19. {% endif %}