hot-fixes

This commit is contained in:
Astro 2016-11-14 21:49:38 +01:00
parent 5d5b639a87
commit 0b1714119c
7 changed files with 54 additions and 14 deletions

View File

@ -33,6 +33,22 @@ switches:
vlans:
- mgmt
- pub
- up1
server1:
mode: trunk
ports:
- '37'
- '38'
- '39'
- '40'
vlans:
- mgmt
- pub
- core
- up1
- priv1
- priv2
- serv
mgmt:
mode: access
ports:
@ -43,8 +59,6 @@ switches:
- '2'
- '3'
- '24'
- '37'
- '48'
switch-b2:
model: '3com-4200G'
location: Haus B Souterrain
@ -81,6 +95,7 @@ switches:
vlans:
- mgmt
- pub
- up1
up1:
mode: access
ports:

View File

@ -7,3 +7,19 @@ vlans:
up2: 11
up3: 12
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

View File

@ -1,3 +1,6 @@
procps:
pkg.installed: []
/etc/sysctl.d/80-forwarding.conf:
file.managed:
- source: "salt://forwarding/forwarding.conf"
@ -7,3 +10,4 @@ apply:
- name: sysctl -p /etc/sysctl.d/80-forwarding.conf
require:
- file: /etc/sysctl.d/80-forwarding.conf
- pkg: procps

View File

@ -31,7 +31,7 @@ upstream1:
core:
type: veth
up1:
type: veth
type: phys
anon1:
interfaces:

View File

@ -19,8 +19,8 @@ lxc:
- context:
id: {{ id }}
container: {{ container }}
- require_in:
cmd: /var/lib/lxc/{{ id }}
- require:
- cmd: /var/lib/lxc/{{ id }}
/var/lib/lxc/{{ id }}/rootfs/etc/hosts:
file.managed:
@ -29,8 +29,8 @@ lxc:
- context:
id: {{ id }}
container: {{ container }}
- require_in:
cmd: /var/lib/lxc/{{ id }}
- require:
- cmd: /var/lib/lxc/{{ id }}
autostart-{{ id }}:
service.enabled:

View File

@ -29,7 +29,7 @@ bond0.{{ vlan }}:
- network: bond0
{% endfor %}
{%- for net in ['core', 'serv'] %}
{%- for net in ['core', 'serv', 'mgmt'] %}
{%- set vlan = pillar['vlans'][net] %}
br-{{ net }}:
network.managed:
@ -41,6 +41,9 @@ br-{{ net }}:
proto: static
address: {{ ip_addr }}
netmask: {{ netmasks[prefix_len] }}
{%- if net == 'core' %}
gateway: {{ pillar['hosts-inet']['core']['upstream1'] }}
{%- endif %}
{%- else %}
proto: manual
{%- endif %}

View File

@ -31,7 +31,7 @@ send "quit\r"
expect "{{ hostname }}]"
{%- for name, vlan in pillar['vlans'].items() %}
{%- if name == 'mgmt' %}
send "vlan {{ vlan }}\r"
expect -- "-vlan{{ vlan }}]"
send "description {{ name }}\r"
@ -44,15 +44,15 @@ send "interface Vlan-interface {{ vlan }}\r"
expect "]"
send "description {{ name }}\r"
expect "]"
{%- set net_hosts = pillar['hosts-inet'].get(name) %}
{%- set ipaddr = net_hosts and net_hosts.get(hostname) %}
{%- if ipaddr %}
{%- set net_hosts = pillar['hosts-inet'].get(name) %}
{%- set ipaddr = net_hosts and net_hosts.get(hostname) %}
{%- if ipaddr %}
send "ip address {{ ipaddr }} {{ netmasks[pillar['subnets-inet'][name].split('/')[1]] }}\r"
expect "]"
{%- endif %}
{%- endif %}
send "quit\r"
expect "{{ hostname }}]"
{%- endif %}
{%- endfor %}
{%- set group = 0 %}
@ -64,6 +64,8 @@ send "interface gigabitEthernet 1/0/{{ port }}\r"
expect "]"
send "lacp enable\r"
expect "]"
send "undo port link-aggregation group\r"
expect "]"
send "port link-aggregation group {{ group }}\r"
expect "]"
send "port link-type trunk\r"