Browse Source

Change routes syntax and logical

tags/v0.1
root 10 years ago
parent
commit
a1e0454053
2 changed files with 16 additions and 7 deletions
  1. +8
    -0
      network/defaults.yaml
  2. +8
    -7
      network/routes.sls

+ 8
- 0
network/defaults.yaml View File

- pre_down_cmds - pre_down_cmds
- post_up_cmds - post_up_cmds
- post_down_cmds - post_down_cmds
# bonding
- master
- mode
- slaves
#TODO - broadcast #TODO - broadcast
def_entries: def_entries:
- name: lo - name: lo
- pre_down_cmds - pre_down_cmds
- post_up_cmds - post_up_cmds
- post_down_cmds - post_down_cmds
# bonding
- master
- mode
- slaves
#TODO - broadcast #TODO - broadcast
def_entries: [] def_entries: []
# - name: lo # - name: lo

+ 8
- 7
network/routes.sls View File

#!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 %}
{% set datamap = salt['grains.filter_by'](rawmap, merge=salt['pillar.get']('network')) %}


#{% from "network/defaults.yaml" import rawmap with context %}
{% set datamap = salt['pillar.get']('network') %}
{% set routes = datamap.routes %}
{%- macro set_p(paramname, dictvar) -%}
{%- if paramname in dictvar -%}
{{ paramname }}: {{ dictvar[paramname] }}
{%- endif -%}
{%- endmacro -%}


{% if salt['pillar.get']('network:routes', False) %}


{% for r in routes %}
{% for r in datamap.routes %}
{{ r.name }}: {{ r.name }}:
network.routes: network.routes:
- name: {{ r.name }} - name: {{ r.name }}
gateway: {{ n.gateway }} gateway: {{ n.gateway }}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}

{% endif %}

Loading…
Cancel
Save