From 87dcb17d15e93e1d4c4df57415977cac8162d205 Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Tue, 23 May 2017 13:50:44 +0100 Subject: [PATCH] Add translations test-site deployment option We want to set-up a test-site for translations as a separate scenario of an AIO. This will assist the translations team to test translations throughout the cycle. In order for Trove to build successfully we need some Network setup which is added in this patch. Change-Id: I0a8bef400e5c99d9258022fac7e740632ed4b796 --- etc/openstack_deploy/conf.d/trove.yml.aio | 84 +++++++++++++++++++ tests/bootstrap-aio.yml | 14 ++++ .../tasks/prepare_networking.yml | 24 +++--- .../templates/osa_interfaces.cfg.j2 | 19 +++++ .../user_variables.translations.yml.j2 | 9 ++ 5 files changed, 140 insertions(+), 10 deletions(-) create mode 100644 tests/roles/bootstrap-host/templates/user_variables.translations.yml.j2 diff --git a/etc/openstack_deploy/conf.d/trove.yml.aio b/etc/openstack_deploy/conf.d/trove.yml.aio index 97d9e29d33..f05bd76c22 100644 --- a/etc/openstack_deploy/conf.d/trove.yml.aio +++ b/etc/openstack_deploy/conf.d/trove.yml.aio @@ -1,3 +1,87 @@ +cidr_networks: + dbaas: 172.29.232.0/22 + container: 172.29.236.0/22 + tunnel: 172.29.240.0/22 + storage: 172.29.244.0/22 + +used_ips: + - "172.29.232.1,172.29.232.50" + - "172.29.232.100" + - "172.29.233.100,172.29.233.210" + - "172.29.236.1,172.29.236.50" + - "172.29.236.100" + - "172.29.240.1,172.29.240.50" + - "172.29.240.100" + - "172.29.244.1,172.29.244.50" + - "172.29.244.100" + - "172.29.248.1,172.29.248.50" + - "172.29.248.100" + +global_overrides: + provider_networks: + - network: + container_bridge: "br-mgmt" + container_type: "veth" + container_interface: "eth1" + ip_from_q: "container" + type: "raw" + group_binds: + - all_containers + - hosts + is_container_address: true + is_ssh_address: true + - network: + container_bridge: "br-vxlan" + container_type: "veth" + container_interface: "eth10" + ip_from_q: "tunnel" + type: "vxlan" + range: "1:1000" + net_name: "vxlan" + group_binds: + - neutron_linuxbridge_agent + - network: + container_bridge: "br-vlan" + container_type: "veth" + container_interface: "eth12" + host_bind_override: "eth12" + type: "flat" + net_name: "flat" + group_binds: + - neutron_linuxbridge_agent + - network: + container_bridge: "br-dbaas" + container_type: "veth" + container_interface: "eth13" + host_bind_override: "eth13" + ip_from_q: "dbaas" + type: "flat" + net_name: "flat-db" + group_binds: + - neutron_linuxbridge_agent + - rabbitmq + - network: + container_bridge: "br-vlan" + container_type: "veth" + container_interface: "eth11" + type: "vlan" + range: "1:1" + net_name: "vlan" + group_binds: + - neutron_linuxbridge_agent + - network: + container_bridge: "br-storage" + container_type: "veth" + container_interface: "eth2" + ip_from_q: "storage" + type: "raw" + group_binds: + - glance_api + - cinder_api + - cinder_volume + - nova_compute + - swift_proxy + trove-infra_hosts: aio1: ip: 172.29.236.100 diff --git a/tests/bootstrap-aio.yml b/tests/bootstrap-aio.yml index 69784faebf..fb29aa84a4 100644 --- a/tests/bootstrap-aio.yml +++ b/tests/bootstrap-aio.yml @@ -44,6 +44,20 @@ - name: keystone.yml.aio - name: neutron.yml.aio - name: nova.yml.aio + translations: + - name: cinder.yml.aio + - name: designate.yml.aio + - name: glance.yml.aio + - name: heat.yml.aio + - name: horizon.yml.aio + - name: keystone.yml.aio + - name: neutron.yml.aio + - name: nova.yml.aio + - name: swift.yml.aio + - name: sahara.yml.aio + - name: magnum.yml.aio + - name: octavia.yml.aio + - name: trove.yml.aio sftp_subsystem: "{{ (ansible_pkg_mgr == 'apt') | ternary('sftp /usr/lib/openssh/sftp-server','sftp /usr/libexec/openssh/sftp-server') }}" sshd: ListenAddress: diff --git a/tests/roles/bootstrap-host/tasks/prepare_networking.yml b/tests/roles/bootstrap-host/tasks/prepare_networking.yml index 8f43592810..fcf55b63dc 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_networking.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_networking.yml @@ -96,13 +96,15 @@ - networking-interfaces-load - name: Shut down the network interfaces - command: "ifdown {{ item }}" + command: "ifdown {{ item.name }}" when: osa_interfaces | changed or osa_multinode_interfaces | changed or network_interfaces_rhel | changed with_items: - - br-mgmt - - br-storage - - br-vlan - - br-vxlan + - { name: br-mgmt } + - { name: br-storage } + - { name: br-vlan } + - { name: br-vxlan } + - { name: br-dbaas, enabled: "{{ (bootstrap_host_scenario == 'translations') | bool }}" } + when: item.enabled | default(True) tags: - networking-interfaces-stop @@ -125,13 +127,15 @@ - networking-interfaces-start - name: Start the network interfaces - command: "ifup {{ item }}" + command: "ifup {{ item.name }}" when: osa_interfaces | changed or network_interfaces_rhel | changed with_items: - - br-mgmt - - br-storage - - br-vlan - - br-vxlan + - { name: br-mgmt } + - { name: br-storage } + - { name: br-vlan } + - { name: br-vxlan } + - { name: br-dbaas, enabled: "{{ (bootstrap_host_scenario == 'translations') | bool }}" } + when: item.enabled | default(True) tags: - networking-interfaces-start diff --git a/tests/roles/bootstrap-host/templates/osa_interfaces.cfg.j2 b/tests/roles/bootstrap-host/templates/osa_interfaces.cfg.j2 index 3e8e149291..cf998f5323 100644 --- a/tests/roles/bootstrap-host/templates/osa_interfaces.cfg.j2 +++ b/tests/roles/bootstrap-host/templates/osa_interfaces.cfg.j2 @@ -58,6 +58,25 @@ iface br-vlan inet static post-down ip link del br-vlan-veth || true bridge_ports br-vlan-veth +{% if bootstrap_host_scenario == "translations" %} +auto br-dbaas +iface br-dbaas inet static + bridge_stp off + bridge_waitport 0 + bridge_fd 0 + address 172.29.232.100 + netmask 255.255.252.0 + offload-sg off + # Create veth pair, don't bomb if already exists + pre-up ip link add br-dbaas-veth type veth peer name eth13 || true + # Set both ends UP + pre-up ip link set br-dbaas-veth up + pre-up ip link set eth13 up + # Delete veth pair on DOWN + post-down ip link del br-dbaas-veth || true + bridge_ports br-dbaas-veth + +{% endif %} # Add an additional address to br-vlan iface br-vlan inet static # Flat network default gateway diff --git a/tests/roles/bootstrap-host/templates/user_variables.translations.yml.j2 b/tests/roles/bootstrap-host/templates/user_variables.translations.yml.j2 new file mode 100644 index 0000000000..7b1f609ee0 --- /dev/null +++ b/tests/roles/bootstrap-host/templates/user_variables.translations.yml.j2 @@ -0,0 +1,9 @@ +{% include 'user_variables.aio.yml.j2' %} + +# Trove settings for translations site. +trove_provider_net_name: flat-db +trove_service_net_phys_net: flat-db +trove_service_net_setup: True +trove_service_net_subnet_cidr: "172.29.232.0/22" +trove_service_net_allocation_pool_start: "172.29.233.110" +trove_service_net_allocation_pool_end: "172.29.233.200"