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

22 行
761B

  1. #!jinja|yaml
  2. {% from "network/defaults.yaml" import rawmap with context %}
  3. {% set datamap = salt['grains.filter_by'](rawmap, merge=salt['pillar.get']('network')) %}
  4. {# TODO: The function name 'routes' in 'network.routes' should be moved into the list as soon as it's possible
  5. for code convention reasons. Unfortunately 'routes' is also used in **kwargs when calling ip.build_routes
  6. in salt.states.network #}
  7. {% for k, v in datamap.routes|default({})|dictsort %}
  8. routes_{{ v.name|default(k) }}:
  9. network.routes:
  10. - name: {{ v.name|default(k) }}
  11. - routes:
  12. {% for net in v.networks %}
  13. - name: {{ net.name }}
  14. ipaddr: {{ net.ipaddr }}
  15. netmask: {{ net.netmask }}
  16. gateway: {{ net.gateway }}
  17. {% endfor %}
  18. {% endfor %}