|
|
|
|
|
|
|
|
#!jinja|yaml |
|
|
#!jinja|yaml |
|
|
# vim: sts=2 ts=2 sw=2 et ai |
|
|
# vim: sts=2 ts=2 sw=2 et ai |
|
|
|
|
|
|
|
|
{% from "network/defaults.yaml" import rawmap with context %} |
|
|
{% from "network/defaults.yaml" import rawmap with context %} |
|
|
{% set datamap = salt['grains.filter_by'](rawmap, merge=salt['pillar.get']('network')) %} |
|
|
{% set datamap = salt['grains.filter_by'](rawmap, merge=salt['pillar.get']('network')) %} |
|
|
|
|
|
|
|
|
{% for r in datamap.routes %} |
|
|
|
|
|
|
|
|
{# TODO: The function name 'routes' in 'network.routes' should be moved into the list as soon as it's possible |
|
|
|
|
|
for code convention reasons. Unfortunately 'routes' is also used in **kwargs when calling ip.build_routes |
|
|
|
|
|
in salt.states.network #} |
|
|
|
|
|
{% for r in datamap.routes|default([]) %} |
|
|
{{ r.name }}: |
|
|
{{ r.name }}: |
|
|
network.routes: |
|
|
network.routes: |
|
|
- name: {{ r.name }} |
|
|
|
|
|
- routes: |
|
|
- routes: |
|
|
{% for n in r.networks %} |
|
|
|
|
|
- name: {{ n.name }} |
|
|
|
|
|
|
|
|
{% for n in r.networks %} |
|
|
|
|
|
- name: {{ n.name }} |
|
|
ipaddr: {{ n.ipaddr }} |
|
|
ipaddr: {{ n.ipaddr }} |
|
|
netmask: {{ n.netmask }} |
|
|
|
|
|
gateway: {{ n.gateway }} |
|
|
|
|
|
{% endfor %} |
|
|
|
|
|
|
|
|
netmask: {{ n.netmask }} |
|
|
|
|
|
gateway: {{ n.gateway }} |
|
|
|
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
{% endfor %} |