From e09216aa4e22dc63c0263cdd214cc8662b5b9bab Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Thu, 14 Sep 2017 21:38:42 +0100 Subject: [PATCH] Implement a scenario with no containers In order to demonstrate that OSA can be built without any containers, and to validate on a continuous basis that it still works, a new scenario is implemented to test it. As part of this, the following is done: 1. An example environment override file is added which sets all the containers with 'is_metal: true' which disables the container creation. 2. As haproxy is not used for the scenario on an AIO, the haproxy environment configuration is broken out from openstack_user_config into its own conf.d file and the implementation of it into user space is added to all other scenarios. 3. To ensure that the pip lockdown configuration is not implemented by the pip install role when the repo server doesn't exist yet, we ensure that the var is set in the playbook that does the validation. 4. To ensure that rabbitmq is able to correctly start up we implement the same host name on the host as we do in the inventory. Without this rabbitmq fails. In order to do this successfully with ansible, the dbus package must be installed on the host, so it is added as part of the AIO bootstrapping. 5. The workflow for a deployment needs no changes because when the lxc-related playbooks execute, they simply skip over because the lxc-related groups are empty. Depends-On: https://review.openstack.org/542307 Change-Id: I67199e1f35c91c4e2c9973e011e856c6ac3fb086 --- etc/openstack_deploy/conf.d/haproxy.yml.aio | 4 + .../env.d/aio_metal.yml.example | 158 ++++++++++++++++++ .../openstack_user_config.yml.aio.j2 | 4 - .../common-tasks/set-pip-upstream-url.yml | 3 + tests/roles/bootstrap-host/tasks/main.yml | 5 + .../tasks/prepare_aio_config.yml | 7 + .../bootstrap-host/tasks/prepare_hostname.yml | 34 ++++ tests/roles/bootstrap-host/vars/redhat.yml | 1 + tests/roles/bootstrap-host/vars/suse.yml | 1 + tests/roles/bootstrap-host/vars/ubuntu.yml | 1 + tests/vars/bootstrap-aio-vars.yml | 13 ++ zuul.d/jobs.yaml | 7 + zuul.d/project.yaml | 1 + 13 files changed, 235 insertions(+), 4 deletions(-) create mode 100644 etc/openstack_deploy/conf.d/haproxy.yml.aio create mode 100644 etc/openstack_deploy/env.d/aio_metal.yml.example create mode 100644 tests/roles/bootstrap-host/tasks/prepare_hostname.yml diff --git a/etc/openstack_deploy/conf.d/haproxy.yml.aio b/etc/openstack_deploy/conf.d/haproxy.yml.aio new file mode 100644 index 0000000000..33107c65ce --- /dev/null +++ b/etc/openstack_deploy/conf.d/haproxy.yml.aio @@ -0,0 +1,4 @@ +--- +haproxy_hosts: + aio1: + ip: 172.29.236.100 diff --git a/etc/openstack_deploy/env.d/aio_metal.yml.example b/etc/openstack_deploy/env.d/aio_metal.yml.example new file mode 100644 index 0000000000..af6674e6c2 --- /dev/null +++ b/etc/openstack_deploy/env.d/aio_metal.yml.example @@ -0,0 +1,158 @@ +--- +container_skel: + aodh_container: + properties: + is_metal: true + barbican_container: + properties: + is_metal: true + ceilometer_central_container: + properties: + is_metal: true + metering-compute_container: + properties: + is_metal: true + ceph-mon_container: + properties: + is_metal: true + cinder_api_container: + properties: + is_metal: true + cinder_scheduler_container: + properties: + is_metal: true + cinder_volumes_container: + properties: + is_metal: true + designate_container: + properties: + is_metal: true + etcd_container: + properties: + is_metal: true + galera_container: + properties: + is_metal: true + glance_container: + properties: + is_metal: true + gnocchi_container: + properties: + is_metal: true + haproxy_container: + properties: + is_metal: true + heat_apis_container: + properties: + is_metal: true + heat_api_container: + properties: + is_metal: true + heat_engine_container: + properties: + is_metal: true + horizon_container: + properties: + is_metal: true + ironic_api_container: + properties: + is_metal: true + ironic_conductor_container: + properties: + is_metal: true + ironic_server_container: + properties: + is_metal: true + ironic_compute_container: + properties: + is_metal: true + keystone_container: + properties: + is_metal: true + magnum_container: + properties: + is_metal: true + memcached_container: + properties: + is_metal: true + molteniron-server_container: + properties: + is_metal: true + neutron_agents_container: + properties: + is_metal: true + neutron_server_container: + properties: + is_metal: true + nova_api_container: + properties: + is_metal: true + nova_api_metadata_container: + properties: + is_metal: true + nova_api_os_compute_container: + properties: + is_metal: true + nova_api_placement_container: + properties: + is_metal: true + nova_compute_container: + properties: + is_metal: true + nova_conductor_container: + properties: + is_metal: true + nova_scheduler_container: + properties: + is_metal: true + nova_console_container: + properties: + is_metal: true + octavia_server_container: + properties: + is_metal: true + repo_container: + properties: + is_metal: true + rabbit_mq_container: + properties: + is_metal: true + rsyslog_container: + properties: + is_metal: true + sahara_container: + properties: + is_metal: true + swift_remote_container: + properties: + is_metal: true + swift_proxy_container: + properties: + is_metal: true + swift_acc_container: + properties: + is_metal: true + swift_obj_container: + properties: + is_metal: true + swift_cont_container: + properties: + is_metal: true + tacker_container: + properties: + is_metal: true + trove_api_container: + properties: + is_metal: true + trove_conductor_container: + properties: + is_metal: true + trove_taskmanager_container: + properties: + is_metal: true + unbound_container: + properties: + is_metal: true + utility_container: + properties: + is_metal: true diff --git a/etc/openstack_deploy/openstack_user_config.yml.aio.j2 b/etc/openstack_deploy/openstack_user_config.yml.aio.j2 index cd5f51ccc1..4edfc671fc 100644 --- a/etc/openstack_deploy/openstack_user_config.yml.aio.j2 +++ b/etc/openstack_deploy/openstack_user_config.yml.aio.j2 @@ -128,7 +128,3 @@ repo-infra_hosts: log_hosts: aio1: ip: 172.29.236.100 - -haproxy_hosts: - aio1: - ip: 172.29.236.100 diff --git a/playbooks/common-tasks/set-pip-upstream-url.yml b/playbooks/common-tasks/set-pip-upstream-url.yml index 1fde835fcc..255a049160 100644 --- a/playbooks/common-tasks/set-pip-upstream-url.yml +++ b/playbooks/common-tasks/set-pip-upstream-url.yml @@ -27,9 +27,12 @@ tags: - common-pip +# If we can't reach the internal repo, we need to ensure +# pip isn't locked to it. - name: Set pip upstream URL set_fact: pip_upstream_url: "https://bootstrap.pypa.io/get-pip.py" + pip_lock_to_internal_repo: false when: - pip_upstream_url != "https://bootstrap.pypa.io/get-pip.py" - (_repo_data_check.status | default(503)) != 200 diff --git a/tests/roles/bootstrap-host/tasks/main.yml b/tests/roles/bootstrap-host/tasks/main.yml index 2bcee40335..cdbbf5eb09 100644 --- a/tests/roles/bootstrap-host/tasks/main.yml +++ b/tests/roles/bootstrap-host/tasks/main.yml @@ -95,6 +95,11 @@ tags: - prepare-octavia +# Ensure hostname/ip is consistent with inventory +- include: prepare_hostname.yml + tags: + - prepare-hostname + # Prepare the network interfaces - include: prepare_networking.yml tags: diff --git a/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml b/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml index d99ad0f207..1c1bb6eb22 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml @@ -141,6 +141,13 @@ when: - "bootstrap_host_scenario == 'ceph'" +- name: Copy modified env.d file for metal scenario + copy: + src: "{{ playbook_dir }}/../etc/openstack_deploy/env.d/aio_metal.yml.example" + dest: "/etc/openstack_deploy/env.d/aio_metal.yml" + when: + - "bootstrap_host_scenario == 'aio_metal'" + - name: Add user_conf_files to contain the list of files to copy into containers file: path: /etc/openstack_deploy/user_conf_files.yml diff --git a/tests/roles/bootstrap-host/tasks/prepare_hostname.yml b/tests/roles/bootstrap-host/tasks/prepare_hostname.yml new file mode 100644 index 0000000000..ef7e017b53 --- /dev/null +++ b/tests/roles/bootstrap-host/tasks/prepare_hostname.yml @@ -0,0 +1,34 @@ +--- +# Copyright 2018, 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: Ensure the hosts file is templated appropriately + copy: + content: | + 127.0.0.1 localhost aio1 + 127.0.1.1 aio1.openstack.local aio1 + + # The following lines are desirable for IPv6 capable hosts + ::1 ip6-localhost ip6-loopback + fe00::0 ip6-localnet + ff00::0 ip6-mcastprefix + ff02::1 ip6-allnodes + ff02::2 ip6-allrouters + ff02::3 ip6-allhosts + dest: /etc/hosts + backup: yes + +- name: Ensure hostname is set + hostname: + name: aio1 diff --git a/tests/roles/bootstrap-host/vars/redhat.yml b/tests/roles/bootstrap-host/vars/redhat.yml index ac8d31e3fb..559bfa70c0 100644 --- a/tests/roles/bootstrap-host/vars/redhat.yml +++ b/tests/roles/bootstrap-host/vars/redhat.yml @@ -18,6 +18,7 @@ rdo_package: "https://rdoproject.org/repos/openstack-pike/rdo-release-pike.rpm" packages_install: - bridge-utils - curl + - dbus - ethtool - git - iputils diff --git a/tests/roles/bootstrap-host/vars/suse.yml b/tests/roles/bootstrap-host/vars/suse.yml index 0bb027b146..2c76b86d31 100644 --- a/tests/roles/bootstrap-host/vars/suse.yml +++ b/tests/roles/bootstrap-host/vars/suse.yml @@ -21,6 +21,7 @@ opensuse_openstack_repos: packages_install: - bridge-utils - curl + - dbus - ethtool - git-core - lvm2 diff --git a/tests/roles/bootstrap-host/vars/ubuntu.yml b/tests/roles/bootstrap-host/vars/ubuntu.yml index 916115e93a..32d07a556c 100644 --- a/tests/roles/bootstrap-host/vars/ubuntu.yml +++ b/tests/roles/bootstrap-host/vars/ubuntu.yml @@ -17,6 +17,7 @@ packages_install: - bridge-utils - build-essential - curl + - dbus - ethtool - git-core - ipython diff --git a/tests/vars/bootstrap-aio-vars.yml b/tests/vars/bootstrap-aio-vars.yml index ef61dbf739..cd4c4facdd 100644 --- a/tests/vars/bootstrap-aio-vars.yml +++ b/tests/vars/bootstrap-aio-vars.yml @@ -15,6 +15,7 @@ confd_overrides: aio_lxc: + - name: haproxy.yml.aio - name: cinder.yml.aio - name: designate.yml.aio - name: glance.yml.aio @@ -24,7 +25,16 @@ confd_overrides: - name: neutron.yml.aio - name: nova.yml.aio - name: swift.yml.aio + aio_metal: + - name: cinder.yml.aio + - name: glance.yml.aio + - name: heat.yml.aio + - name: keystone.yml.aio + - name: neutron.yml.aio + - name: nova.yml.aio + - name: swift.yml.aio ceph: + - name: haproxy.yml.aio - name: ceph.yml.aio - name: cinder.yml.aio - name: glance.yml.aio @@ -32,6 +42,7 @@ confd_overrides: - name: neutron.yml.aio - name: nova.yml.aio translations: + - name: haproxy.yml.aio - name: cinder.yml.aio - name: designate.yml.aio - name: glance.yml.aio @@ -46,12 +57,14 @@ confd_overrides: - name: octavia.yml.aio - name: trove.yml.aio octavia: + - name: haproxy.yml.aio - name: glance.yml.aio - name: keystone.yml.aio - name: neutron.yml.aio - name: nova.yml.aio - name: octavia.yml.aio tacker: + - name: haproxy.yml.aio - name: keystone.yml.aio - name: heat.yml.aio - name: tacker.yml.aio diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 7db7080fa2..1973ba0302 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -59,6 +59,13 @@ vars: action: deploy scenario: ceph +- job: + name: openstack-ansible-deploy-aio_metal-ubuntu-xenial + parent: openstack-ansible-deploy-aio-ubuntu-xenial + voting: false + vars: + action: deploy + scenario: aio_metal - job: name: openstack-ansible-upgrade-aio_lxc-ubuntu-xenial diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index c4c8ade215..eb5927478e 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -23,6 +23,7 @@ - openstack-ansible-deploy-ceph-centos-7 - openstack-ansible-deploy-ceph-ubuntu-xenial - openstack-ansible-deploy-ceph-opensuse-423 + - openstack-ansible-deploy-aio_metal-ubuntu-xenial experimental: jobs: - openstack-ansible-deploy-octavia-ubuntu-xenial