Browse Source

Merge pull request #3 from fessoga5/master

Fixes for support routes.
tags/v0.1
Arnold Bechtoldt 10 years ago
parent
commit
3f8b066ba1
4 changed files with 47 additions and 0 deletions
  1. +9
    -0
      network/defaults.yaml
  2. +12
    -0
      network/interfaces.sls
  3. +17
    -0
      network/routes.sls
  4. +9
    -0
      pillar.example.sls

+ 9
- 0
network/defaults.yaml View File

# vim: sts=2 ts=2 sw=2 et ai
{% load_yaml as rawmap %} {% load_yaml as rawmap %}
Debian: Debian:
interfaces: interfaces:
- 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

+ 12
- 0
network/interfaces.sls View File

- network: network-{{ u }} - network: network-{{ u }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% if n.provider is defined %}
- provider: {{ n.provider }}
{% endif %}
{% if n.user is defined %}
- user: {{ n.user }}
{% endif %}
{% if n.password is defined %}
- password: {{ n.password }}
{% endif %}
{% if n.pppoe_iface is defined %}
- pppoe_iface: {{ n.pppoe_iface }}
{% endif %}
{% if n.type|default(datamap.interfaces.default_values.type) == 'vlan' and datamap.interfaces.vlan_pkg|default('vlan') %} {% if n.type|default(datamap.interfaces.default_values.type) == 'vlan' and datamap.interfaces.vlan_pkg|default('vlan') %}
{% do pkgs.append(datamap.interfaces.vlan_pkg|default('vlan')) %} {% do pkgs.append(datamap.interfaces.vlan_pkg|default('vlan')) %}
- require: - require:

+ 17
- 0
network/routes.sls View File

#!jinja|yaml
# 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')) %}

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

+ 9
- 0
pillar.example.sls View File

- name: example.net - name: example.net
ip: 192.168.2.200 ip: 192.168.2.200
ensure: absent ensure: absent

routes:
- name: eth1
networks:
- name: for_lan
ipaddr: 172.16.0.0
netmask: 255.255.0.0
gateway: 192.168.2.1

Loading…
Cancel
Save