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

18 行
488B

  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['grains.filter_by'](rawmap, merge=salt['pillar.get']('network')) %}
  5. {% for r in datamap.routes %}
  6. {{ r.name }}:
  7. network.routes:
  8. - name: {{ r.name }}
  9. - routes:
  10. {% for n in r.networks %}
  11. - name: {{ n.name }}
  12. ipaddr: {{ n.ipaddr }}
  13. netmask: {{ n.netmask }}
  14. gateway: {{ n.gateway }}
  15. {% endfor %}
  16. {% endfor %}