Files
openstack-ansible/tests/roles/bootstrap-host/templates/aio1_networks.yml.j2
Dmitriy Rabotyagov 31f12f54ea Offload network provisionment for AIO to openstack_hosts
For couple of cycles we include our systemd-related roles in
openstack_hosts role, with purpose of operators being able to
configure their nodes before any actuall service or infra role will
kick in.

This should also provide ability to configure networking for LXC and
setup overall.

So with moving systemd role includes during AIO setup to
variables which leverage openstack_hosts behavior we achieve
multiple goals at once:
- Reduce amount of intersecting logic in AIO bootstrap
- Add testing for openstack_hosts section and ensure it's functional
- Improve transparency for deployers and ability to see and change
network configuration, as it will be templated as variables file
instead of be directly applied.

As a consequence, we need to access host by it's already established
IP address, rather then one defined by us.
However, we already require having `bootstrap_host_public_address`
and rely on it heavily, so it should not bring much regressions
with the approach.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-haproxy_server/+/953670
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/954316
Change-Id: Ib688a5a758ec5ebbd0ebafdcaf2b27aeecdd9aba
Signed-off-by: Dmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
2025-08-18 14:37:30 +02:00

187 lines
5.8 KiB
Django/Jinja

---
# Copyright 2025, Cleura AB
#
# 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.
systemd_interface_cleanup: true
aio_systemd_networkd_devices_bootstrap:
- NetDev:
Name: dummy-mgmt
Kind: dummy
- NetDev:
Name: dummy-vxlan
Kind: dummy
- NetDev:
Name: dummy-storage
Kind: dummy
- NetDev:
Name: dummy-vlan
Kind: dummy
- NetDev:
Name: dummy-dbaas
Kind: dummy
- NetDev:
Name: dummy-lbaas
Kind: dummy
- NetDev:
Name: dummy-bmaas
Kind: dummy
- 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-bmaas
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
- NetDev:
Name: br-bmaas-veth
Kind: veth
Peer:
Name: eth15
aio_systemd_networkd_networks_bootstrap:
- interface: "dummy-mgmt"
bridge: "br-mgmt"
mtu: 9000
- interface: "br-mgmt"
config_overrides:
Network:
Address:
? {{ [bootstrap_host_management_address, mgmt_network | ansible.utils.ipaddr('prefix')] | join('/') }}
? {{ [bootstrap_host_internal_address, mgmt_network | ansible.utils.ipaddr('prefix')] | join('/') }}
- interface: "dummy-storage"
bridge: "br-storage"
mtu: 9000
- interface: "br-storage"
address: "{{ storage_network | ansible.utils.nthhost('100') }}"
netmask: "{{ storage_network | ansible.utils.ipaddr('netmask') }}"
- interface: "dummy-dbaas"
bridge: "br-dbaas"
mtu: 9000
- interface: "br-dbaas"
address: "{{ dbaas_network | ansible.utils.nthhost('100') }}"
netmask: "{{ dbaas_network | ansible.utils.ipaddr('netmask') }}"
- interface: "br-dbaas-veth"
bridge: "br-dbaas"
mtu: 9000
- interface: "dummy-lbaas"
bridge: "br-lbaas"
mtu: 9000
- interface: "br-lbaas"
address: "{{ lbaas_network | ansible.utils.nthhost('100') }}"
netmask: "{{ lbaas_network | ansible.utils.ipaddr('netmask') }}"
- interface: "br-lbaas-veth"
bridge: "br-lbaas"
mtu: 9000
- interface: "dummy-bmaas"
bridge: "br-bmaas"
mtu: 1500
- interface: "br-bmaas"
address: "{{ bmaas_network | ansible.utils.nthhost('100') }}"
netmask: "{{ bmaas_network | ansible.utils.ipaddr('netmask') }}"
- interface: "br-bmaas-veth"
bridge: "br-bmaas"
mtu: 1500
- interface: "dummy-vxlan"
bridge: "br-vxlan"
mtu: 9000
- interface: "br-vxlan"
address: "{{ vxlan_network | ansible.utils.nthhost('100') }}"
netmask: "{{ vxlan_network | ansible.utils.ipaddr('netmask') }}"
- interface: "dummy-vlan"
bridge: "br-vlan"
mtu: 9000
- interface: "br-vlan"
config_overrides:
Network:
Address:
? {{ vlan_network | ansible.utils.ipaddr('100') }}
? {{ vlan_network | ansible.utils.ipaddr('1') }}
- interface: "br-vlan-veth"
bridge: "br-vlan"
mtu: 9000
aio_systemd_services_postnetwork:
- service_name: "networking-post-up"
config_overrides:
Unit:
Description: networking-post-up
After: network-online.target
Wants: network-online.target
Service:
RemainAfterExit: true
service_type: oneshot
execstarts:
- "-{{ bootstrap_host_iptables_path }} -t nat -A POSTROUTING -o {{ bootstrap_host_public_interface }} -j MASQUERADE"
- "-{{ bootstrap_host_ethtool_path }} -K br-mgmt gso off sg off tso off tx off"
- "-{{ bootstrap_host_ethtool_path }} -K br-vxlan gso off sg off tso off tx off"
- "-{{ bootstrap_host_ethtool_path }} -K br-storage gso off sg off tso off tx off"
- "-{{ bootstrap_host_ethtool_path }} -K br-vlan gso off sg off tso off tx off"
- "-{{ bootstrap_host_ethtool_path }} -K br-dbaas gso off sg off tso off tx off"
- "-{{ bootstrap_host_ethtool_path }} -K br-lbaas gso off sg off tso off tx off"
- "-{{ bootstrap_host_ethtool_path }} -K br-bmaas gso off sg off tso off tx off"
- "-{{ bootstrap_host_ip_path }} link set eth12 up"
- "-{{ bootstrap_host_ip_path }} link set br-vlan-veth up"
- "-{{ bootstrap_host_ethtool_path }} -K eth12 gso off sg off tso off tx off"
- "-{{ bootstrap_host_ip_path }} link set eth13 up"
- "-{{ bootstrap_host_ip_path }} link set br-dbaas-veth up"
- "-{{ bootstrap_host_ethtool_path }} -K eth13 gso off sg off tso off tx off"
- "-{{ bootstrap_host_ip_path }} link set eth14 up"
- "-{{ bootstrap_host_ip_path }} link set br-lbaas-veth up"
- "-{{ bootstrap_host_ethtool_path }} -K eth14 gso off sg off tso off tx off"
- "-{{ bootstrap_host_ip_path }} link set eth15 up"
- "-{{ bootstrap_host_ip_path }} link set br-bmaas-veth up"
- "-{{ bootstrap_host_ethtool_path }} -K eth15 gso off sg off tso off tx off"
execstops:
- "{{ bootstrap_host_iptables_path }} -t nat -D POSTROUTING -o {{ bootstrap_host_public_interface }} -j MASQUERADE"
enabled: true
state: started