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

22 行
745B

  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. {# TODO: The function name 'routes' in 'network.routes' should be moved into the list as soon as it's possible
  6. for code convention reasons. Unfortunately 'routes' is also used in **kwargs when calling ip.build_routes
  7. in salt.states.network #}
  8. {% for r in datamap.routes|default([]) %}
  9. routes_{{ r.name }}:
  10. network.routes:
  11. - name: {{ r.name }}
  12. - routes:
  13. {% for n in r.networks %}
  14. - name: {{ n.name }}
  15. ipaddr: {{ n.ipaddr }}
  16. netmask: {{ n.netmask }}
  17. gateway: {{ n.gateway }}
  18. {% endfor %}
  19. {% endfor %}