openstack-ansible/tests/roles/bootstrap-host/tasks/prepare_networking.yml
Kevin Carter f592ed232b Use production like interfaces in the gate
The gate presently sets up a pseudo networking environment using a
collection of bridges without any interfaces within them. This change
implements the production example interface file using dummy
interfaces. With this change we'll have the ability to test a production
networking stack with bonded interfaces, VLAN tags, and
bridges. To ensure we're enabling this setup in a uniform way the
systemd-networkd role is used to create everything needed.

> Terminal output from what will be created with this change
  http://paste.openstack.org/show/702382/

Change-Id: I7fb15ce81056cf7ad5139333d59787e610bd9c75
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-06-11 07:01:46 +00:00

249 lines
6.5 KiB
YAML

---
# Copyright 2015, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Run the systemd-networkd role
include_role:
name: systemd_networkd
private: true
vars:
systemd_interface_cleanup: true
systemd_run_networkd: true
systemd_netdevs:
- NetDev:
Name: bond0
Kind: bond
Bond:
Mode: 802.3ad
TransmitHashPolicy: layer3+4
MIIMonitorSec: 1s
LACPTransmitRate: fast
- NetDev:
Name: bond1
Kind: bond
Bond:
Mode: 802.3ad
TransmitHashPolicy: layer3+4
MIIMonitorSec: 1s
LACPTransmitRate: fast
- NetDev:
Name: dummy0
Kind: dummy
- NetDev:
Name: dummy2
Kind: dummy
- NetDev:
Name: dummy1
Kind: dummy
- NetDev:
Name: dummy3
Kind: dummy
- NetDev:
Name: bond0.110
Kind: vlan
VLAN:
Id: 110
- NetDev:
Name: bond0.120
Kind: vlan
VLAN:
Id: 120
- NetDev:
Name: bond0.130
Kind: vlan
VLAN:
Id: 130
- NetDev:
Name: bond0.140
Kind: vlan
VLAN:
Id: 140
- NetDev:
Name: bond1.210
Kind: vlan
VLAN:
Id: 210
- NetDev:
Name: br-mgmt
Kind: bridge
- NetDev:
Name: br-vxlan
Kind: bridge
- NetDev:
Name: br-storage
Kind: bridge
- NetDev:
Name: br-vlan
Kind: bridge
- NetDev:
Name: br-dbaas
Kind: bridge
- NetDev:
Name: br-lbaas
Kind: bridge
- NetDev:
Name: br-vlan-veth
Kind: veth
Peer:
Name: eth12
- NetDev:
Name: br-dbaas-veth
Kind: veth
Peer:
Name: eth13
- NetDev:
Name: br-lbaas-veth
Kind: veth
Peer:
Name: eth14
systemd_networks:
- interface: "bond0"
config_overrides:
Network:
VLAN:
? "bond0.110"
? "bond0.120"
? "bond0.130"
? "bond0.140"
mtu: 9000
- interface: "bond1"
bridge: "br-vlan"
config_overrides:
Network:
VLAN:
? "bond1.210"
mtu: 9000
- interface: "bond0.110"
bridge: "br-mgmt"
mtu: 9000
- interface: "br-mgmt"
address: "172.29.236.100"
netmask: "255.255.252.0"
- interface: "bond0.120"
bridge: "br-storage"
mtu: 9000
- interface: "br-storage"
address: "172.29.244.100"
netmask: "255.255.252.0"
- interface: "bond0.130"
bridge: "br-dbaas"
mtu: 9000
- interface: "br-dbaas"
address: "172.29.232.100"
netmask: "255.255.252.0"
- interface: "br-dbaas-veth"
bridge: "br-dbaas"
mtu: 9000
- interface: "bond0.140"
bridge: "br-lbaas"
mtu: 9000
- interface: "br-lbaas"
address: "172.29.252.100"
netmask: "255.255.252.0"
- interface: "br-lbaas-veth"
bridge: "br-lbaas"
mtu: 9000
- interface: "bond1.210"
bridge: "br-vxlan"
mtu: 9000
- interface: "br-vxlan"
address: "172.29.240.100"
netmask: "255.255.252.0"
- interface: "br-vlan"
config_overrides:
Network:
Address:
? "172.29.248.100/22"
? "172.29.248.1/22"
- interface: "br-vlan-veth"
bridge: "br-vlan"
mtu: 9000
- interface: "dummy0"
bond: "bond0"
mtu: 9000
- interface: "dummy2"
bond: "bond0"
mtu: 9000
- interface: "dummy1"
bond: "bond1"
mtu: 9000
- interface: "dummy3"
bond: "bond1"
mtu: 9000
tags:
- network-config
- name: Run the systemd service role
include_role:
name: systemd_service
private: true
vars:
systemd_services:
- service_name: "networking-post-up"
config_overrides:
Unit:
Description: networking-post-up
After: network-online.target
Wants: network-online.target
Service:
RemainAfterExit: yes
service_type: oneshot
execstarts:
- "-/sbin/iptables -A POSTROUTING -t mangle -p tcp --dport 22 -j CHECKSUM --checksum-fill"
- "-/sbin/iptables -t nat -A POSTROUTING -o {{ bootstrap_host_public_interface }} -j MASQUERADE"
- "-/sbin/ethtool -K bond0 gso off sg off tso off tx off"
- "-/sbin/ethtool -K bond1 gso off sg off tso off tx off"
- "-/sbin/ethtool -K br-mgmt gso off sg off tso off tx off"
- "-/sbin/ethtool -K br-vxlan gso off sg off tso off tx off"
- "-/sbin/ethtool -K br-storage gso off sg off tso off tx off"
- "-/sbin/ethtool -K br-vlan gso off sg off tso off tx off"
- "-/sbin/ethtool -K br-dbaas gso off sg off tso off tx off"
- "-/sbin/ethtool -K br-lbaas gso off sg off tso off tx off"
- "-/bin/ip link set eth12 up"
- "-/bin/ip link set br-vlan-veth up"
- "-/sbin/ethtool -K eth12 gso off sg off tso off tx off"
- "-/bin/ip link set eth13 up"
- "-/bin/ip link set br-dbaas-veth up"
- "-/sbin/ethtool -K eth13 gso off sg off tso off tx off"
- "-/bin/ip link set eth14 up"
- "-/bin/ip link set br-lbaas-veth up"
- "-/sbin/ethtool -K eth14 gso off sg off tso off tx off"
execstops:
- "/sbin/iptables -D POSTROUTING -t mangle -p tcp --dport 22 -j CHECKSUM --checksum-fill"
- "/sbin/iptables -t nat -D POSTROUTING -o {{ bootstrap_host_public_interface }} -j MASQUERADE"
enabled: yes
state: started
systemd_tempd_prefix: openstack
tags:
- network-config
- name: Updating the facts due to net changes
setup:
filter: "ansible_br*"
tags:
- networking