Bechtoldt's Network Saltstack Formula
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

routes.sls 761B

123456789101112131415161718192021
  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 %}