CI: Add addressing on external network

This is to allow CI testing of network connectivity.

Note only "primary" node gets an address on it.
Hence, "primary" becomes our fake external router.

Depends-on: https://review.opendev.org/709361

Change-Id: I05592888796107d6de95b940c42b2bff73ac0669
This commit is contained in:
Radosław Piliszek 2020-02-23 17:14:47 +01:00
parent 4ac7f6f3a0
commit 195813dd60
4 changed files with 24 additions and 0 deletions

View File

@ -12,6 +12,19 @@ function init_runonce {
echo "Initialising OpenStack resources via init-runonce" echo "Initialising OpenStack resources via init-runonce"
tools/init-runonce &> /tmp/logs/ansible/init-runonce tools/init-runonce &> /tmp/logs/ansible/init-runonce
echo "Setting address on the external network bridge"
if [[ $SCENARIO == "linuxbridge" ]]; then
# NOTE(yoctozepto): linuxbridge agent manages its bridges by itself
# hence, we need to find the current name of the external network bridge
devname=$(basename $(readlink /sys/class/net/${EXT_NET_SLAVE_DEVICE}/master))
else
devname=br-ex
# NOTE(yoctozepto): ovs virtual interfaces are down (not used) by default
# hence, we need to bring the external network bridge up
sudo ip link set ${devname} up
fi
sudo ip addr add ${EXT_NET_LOCAL_ADDR} dev ${devname}
} }

View File

@ -16,6 +16,8 @@
managed_network_prefix: "{{ api_network_prefix }}" managed_network_prefix: "{{ api_network_prefix }}"
managed_network_prefix_length: "{{ api_network_prefix_length }}" managed_network_prefix_length: "{{ api_network_prefix_length }}"
managed_network_address_family: "{{ address_family }}" managed_network_address_family: "{{ address_family }}"
# NOTE(yoctozepto): no addressing for neutron_external_interface in here
# because it is enslaved by a bridge
- role: multi-node-vxlan-overlay - role: multi-node-vxlan-overlay
vars: vars:
vxlan_interface_name: "{{ neutron_external_interface_name }}" vxlan_interface_name: "{{ neutron_external_interface_name }}"

View File

@ -356,6 +356,13 @@
cmd: init-core-openstack.sh cmd: init-core-openstack.sh
executable: /bin/bash executable: /bin/bash
chdir: "{{ kolla_ansible_src_dir }}" chdir: "{{ kolla_ansible_src_dir }}"
environment:
EXT_NET_CIDR: "{{ neutron_external_network_prefix }}0/{{ neutron_external_network_prefix_length }}"
EXT_NET_RANGE: "start={{ neutron_external_network_prefix }}150,end={{ neutron_external_network_prefix }}199"
EXT_NET_GATEWAY: "{{ neutron_external_network_prefix }}1"
EXT_NET_LOCAL_ADDR: "{{ neutron_external_network_prefix }}1/{{ neutron_external_network_prefix_length }}"
EXT_NET_SLAVE_DEVICE: "{{ neutron_external_interface_name }}"
SCENARIO: "{{ scenario }}"
when: openstack_core_tested or scenario in ['ironic', 'scenario_nfv', 'zun'] when: openstack_core_tested or scenario in ['ironic', 'scenario_nfv', 'zun']
- name: Run test-core-openstack.sh script - name: Run test-core-openstack.sh script

View File

@ -32,6 +32,8 @@
api_interface_name: vxlan0 api_interface_name: vxlan0
kolla_internal_vip_address: "192.0.2.10" kolla_internal_vip_address: "192.0.2.10"
address_family: 'ipv4' address_family: 'ipv4'
neutron_external_network_prefix: "198.51.100."
neutron_external_network_prefix_length: "24"
neutron_external_interface_name: vxlan1 neutron_external_interface_name: vxlan1
tls_enabled: false tls_enabled: false
roles: roles: