Bechtoldt's Network Saltstack Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920
  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 r in datamap.routes|default([]) %}
  8. routes_{{ 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 %}