forked from zentralwerk/network
hot-fixes
This commit is contained in:
parent
5d5b639a87
commit
0b1714119c
|
@ -33,6 +33,22 @@ switches:
|
||||||
vlans:
|
vlans:
|
||||||
- mgmt
|
- mgmt
|
||||||
- pub
|
- pub
|
||||||
|
- up1
|
||||||
|
server1:
|
||||||
|
mode: trunk
|
||||||
|
ports:
|
||||||
|
- '37'
|
||||||
|
- '38'
|
||||||
|
- '39'
|
||||||
|
- '40'
|
||||||
|
vlans:
|
||||||
|
- mgmt
|
||||||
|
- pub
|
||||||
|
- core
|
||||||
|
- up1
|
||||||
|
- priv1
|
||||||
|
- priv2
|
||||||
|
- serv
|
||||||
mgmt:
|
mgmt:
|
||||||
mode: access
|
mode: access
|
||||||
ports:
|
ports:
|
||||||
|
@ -43,8 +59,6 @@ switches:
|
||||||
- '2'
|
- '2'
|
||||||
- '3'
|
- '3'
|
||||||
- '24'
|
- '24'
|
||||||
- '37'
|
|
||||||
- '48'
|
|
||||||
switch-b2:
|
switch-b2:
|
||||||
model: '3com-4200G'
|
model: '3com-4200G'
|
||||||
location: Haus B Souterrain
|
location: Haus B Souterrain
|
||||||
|
@ -81,6 +95,7 @@ switches:
|
||||||
vlans:
|
vlans:
|
||||||
- mgmt
|
- mgmt
|
||||||
- pub
|
- pub
|
||||||
|
- up1
|
||||||
up1:
|
up1:
|
||||||
mode: access
|
mode: access
|
||||||
ports:
|
ports:
|
||||||
|
|
|
@ -7,3 +7,19 @@ vlans:
|
||||||
up2: 11
|
up2: 11
|
||||||
up3: 12
|
up3: 12
|
||||||
up4: 13
|
up4: 13
|
||||||
|
priv1: 40
|
||||||
|
priv2: 41
|
||||||
|
priv3: 42
|
||||||
|
priv4: 43
|
||||||
|
priv5: 44
|
||||||
|
priv6: 45
|
||||||
|
priv7: 46
|
||||||
|
priv8: 47
|
||||||
|
priv9: 48
|
||||||
|
priv10: 49
|
||||||
|
priv11: 50
|
||||||
|
priv12: 51
|
||||||
|
priv13: 52
|
||||||
|
priv14: 53
|
||||||
|
priv15: 54
|
||||||
|
priv16: 55
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
procps:
|
||||||
|
pkg.installed: []
|
||||||
|
|
||||||
/etc/sysctl.d/80-forwarding.conf:
|
/etc/sysctl.d/80-forwarding.conf:
|
||||||
file.managed:
|
file.managed:
|
||||||
- source: "salt://forwarding/forwarding.conf"
|
- source: "salt://forwarding/forwarding.conf"
|
||||||
|
@ -7,3 +10,4 @@ apply:
|
||||||
- name: sysctl -p /etc/sysctl.d/80-forwarding.conf
|
- name: sysctl -p /etc/sysctl.d/80-forwarding.conf
|
||||||
require:
|
require:
|
||||||
- file: /etc/sysctl.d/80-forwarding.conf
|
- file: /etc/sysctl.d/80-forwarding.conf
|
||||||
|
- pkg: procps
|
||||||
|
|
|
@ -31,7 +31,7 @@ upstream1:
|
||||||
core:
|
core:
|
||||||
type: veth
|
type: veth
|
||||||
up1:
|
up1:
|
||||||
type: veth
|
type: phys
|
||||||
|
|
||||||
anon1:
|
anon1:
|
||||||
interfaces:
|
interfaces:
|
||||||
|
|
|
@ -19,8 +19,8 @@ lxc:
|
||||||
- context:
|
- context:
|
||||||
id: {{ id }}
|
id: {{ id }}
|
||||||
container: {{ container }}
|
container: {{ container }}
|
||||||
- require_in:
|
- require:
|
||||||
cmd: /var/lib/lxc/{{ id }}
|
- cmd: /var/lib/lxc/{{ id }}
|
||||||
|
|
||||||
/var/lib/lxc/{{ id }}/rootfs/etc/hosts:
|
/var/lib/lxc/{{ id }}/rootfs/etc/hosts:
|
||||||
file.managed:
|
file.managed:
|
||||||
|
@ -29,8 +29,8 @@ lxc:
|
||||||
- context:
|
- context:
|
||||||
id: {{ id }}
|
id: {{ id }}
|
||||||
container: {{ container }}
|
container: {{ container }}
|
||||||
- require_in:
|
- require:
|
||||||
cmd: /var/lib/lxc/{{ id }}
|
- cmd: /var/lib/lxc/{{ id }}
|
||||||
|
|
||||||
autostart-{{ id }}:
|
autostart-{{ id }}:
|
||||||
service.enabled:
|
service.enabled:
|
||||||
|
|
|
@ -29,7 +29,7 @@ bond0.{{ vlan }}:
|
||||||
- network: bond0
|
- network: bond0
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{%- for net in ['core', 'serv'] %}
|
{%- for net in ['core', 'serv', 'mgmt'] %}
|
||||||
{%- set vlan = pillar['vlans'][net] %}
|
{%- set vlan = pillar['vlans'][net] %}
|
||||||
br-{{ net }}:
|
br-{{ net }}:
|
||||||
network.managed:
|
network.managed:
|
||||||
|
@ -41,6 +41,9 @@ br-{{ net }}:
|
||||||
proto: static
|
proto: static
|
||||||
address: {{ ip_addr }}
|
address: {{ ip_addr }}
|
||||||
netmask: {{ netmasks[prefix_len] }}
|
netmask: {{ netmasks[prefix_len] }}
|
||||||
|
{%- if net == 'core' %}
|
||||||
|
gateway: {{ pillar['hosts-inet']['core']['upstream1'] }}
|
||||||
|
{%- endif %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
proto: manual
|
proto: manual
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
|
@ -31,7 +31,7 @@ send "quit\r"
|
||||||
expect "{{ hostname }}]"
|
expect "{{ hostname }}]"
|
||||||
|
|
||||||
{%- for name, vlan in pillar['vlans'].items() %}
|
{%- for name, vlan in pillar['vlans'].items() %}
|
||||||
|
{%- if name == 'mgmt' %}
|
||||||
send "vlan {{ vlan }}\r"
|
send "vlan {{ vlan }}\r"
|
||||||
expect -- "-vlan{{ vlan }}]"
|
expect -- "-vlan{{ vlan }}]"
|
||||||
send "description {{ name }}\r"
|
send "description {{ name }}\r"
|
||||||
|
@ -44,15 +44,15 @@ send "interface Vlan-interface {{ vlan }}\r"
|
||||||
expect "]"
|
expect "]"
|
||||||
send "description {{ name }}\r"
|
send "description {{ name }}\r"
|
||||||
expect "]"
|
expect "]"
|
||||||
{%- set net_hosts = pillar['hosts-inet'].get(name) %}
|
{%- set net_hosts = pillar['hosts-inet'].get(name) %}
|
||||||
{%- set ipaddr = net_hosts and net_hosts.get(hostname) %}
|
{%- set ipaddr = net_hosts and net_hosts.get(hostname) %}
|
||||||
{%- if ipaddr %}
|
{%- if ipaddr %}
|
||||||
send "ip address {{ ipaddr }} {{ netmasks[pillar['subnets-inet'][name].split('/')[1]] }}\r"
|
send "ip address {{ ipaddr }} {{ netmasks[pillar['subnets-inet'][name].split('/')[1]] }}\r"
|
||||||
expect "]"
|
expect "]"
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
send "quit\r"
|
send "quit\r"
|
||||||
expect "{{ hostname }}]"
|
expect "{{ hostname }}]"
|
||||||
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
{%- set group = 0 %}
|
{%- set group = 0 %}
|
||||||
|
@ -64,6 +64,8 @@ send "interface gigabitEthernet 1/0/{{ port }}\r"
|
||||||
expect "]"
|
expect "]"
|
||||||
send "lacp enable\r"
|
send "lacp enable\r"
|
||||||
expect "]"
|
expect "]"
|
||||||
|
send "undo port link-aggregation group\r"
|
||||||
|
expect "]"
|
||||||
send "port link-aggregation group {{ group }}\r"
|
send "port link-aggregation group {{ group }}\r"
|
||||||
expect "]"
|
expect "]"
|
||||||
send "port link-type trunk\r"
|
send "port link-type trunk\r"
|
||||||
|
|
Loading…
Reference in New Issue