hosts: Add vmhost{0,1}.p.b

jenkins-master
Dustin 2018-07-23 17:31:20 -05:00
parent a8dd2e9ec3
commit 11dc40bc76
5 changed files with 132 additions and 0 deletions

View File

@ -0,0 +1,12 @@
dhcpcd_nodev: true
dhcpcd_allow_interfaces:
- enp5s0
- bond1
dhcpcd_interfaces:
- name: bond1
config:
- noipv4
- static ip6_address=fd68:c2d2:500e:3ea3:3c35:bbaf:f9a3:ad9a/64
storage_iface: bond1
samba_interfaces:
- enp5s0

View File

@ -0,0 +1,12 @@
dhcpcd_nodev: true
dhcpcd_allow_interfaces:
- enp5s0
- bond1
dhcpcd_interfaces:
- name: bond1
config:
- noipv4
- static ip6_address=fd68:c2d2:500e:3ea3:8d5f:c3b0:a73c:55d6/64
storage_iface: bond1
samba_interfaces:
- enp5s0

5
hosts
View File

@ -15,6 +15,7 @@ rprx0.pyrocufflink.blue
[dhcpcd:children]
dch-gw
vm-hosts
[dhcpd:children]
dch-gw
@ -43,6 +44,8 @@ git0.pyrocufflink.blue
jenkins0.pyrocufflink.blue
rprx0.pyrocufflink.blue
smtp0.pyrocufflink.blue
vmhost0.pyrocufflink.blue
vmhost1.pyrocufflink.blue
zbx0.pyrocufflink.blue
[pyrocufflink-dns]
@ -72,3 +75,5 @@ dch-gw
pyrocufflink
[vm-hosts]
vmhost0.pyrocufflink.blue
vmhost1.pyrocufflink.blue

View File

@ -0,0 +1,51 @@
#!/bin/sh
set -e
add_slave() {
local master=$1
local slave=$2
ip link set ${slave} down
echo +${slave} > /sys/class/net/${master}/bonding/slaves
ip link set ${slave} up
}
make_bond() {
local bond=$1
local mode=${2:-802.3ad}
if [ ! -d /sys/module/bonding ]; then
modprobe bonding
fi
echo +${bond} > /sys/class/net/bonding_masters
echo ${mode} > /sys/class/net/${bond}/bonding/mode
echo 100 > /sys/class/net/${bond}/bonding/miimon
}
# VM Network
make_bond bond0
add_slave bond0 enp10s0f0
add_slave bond0 enp10s0f1
ip link add link bond0 name vlan30 type vlan id 30
ip link add link bond0 name vlan101 type vlan id 101
ip link set bond0 up
ip link add br0 type bridge
ip link set vlan30 master br0
ip link set br0 up
ip link add br1 type bridge
ip link set vlan101 master br1
ip link set br1 up
# Storage Network
make_bond bond1
add_slave bond1 enp8s0f0
add_slave bond1 enp8s0f1
ip link set bond1 mtu 9000

View File

@ -0,0 +1,52 @@
#!/bin/sh
set -e
add_slave() {
local master=$1
local slave=$2
ip link set ${slave} down
echo +${slave} > /sys/class/net/${master}/bonding/slaves
ip link set ${slave} up
}
make_bond() {
local bond=$1
local mode=${2:-802.3ad}
if [ ! -d /sys/module/bonding ]; then
modprobe bonding
fi
echo +${bond} > /sys/class/net/bonding_masters
echo ${mode} > /sys/class/net/${bond}/bonding/mode
echo 100 > /sys/class/net/${bond}/bonding/miimon
}
# VM Network
make_bond bond0
#add_slave bond0 enp10s0f0
#add_slave bond0 enp10s0f1
add_slave bond0 enp10s0
ip link add link bond0 name vlan30 type vlan id 30
ip link add link bond0 name vlan101 type vlan id 101
ip link set bond0 up
ip link add br0 type bridge
ip link set vlan30 master br0
ip link set br0 up
ip link add br1 type bridge
ip link set vlan101 master br1
ip link set br1 up
# Storage Network
make_bond bond1
add_slave bond1 enp8s0f0
add_slave bond1 enp8s0f1
ip link set bond1 mtu 9000