From eee6c77180375ce7471863fac818c199aad01f1b Mon Sep 17 00:00:00 2001 From: Taseer Ahmed Date: Thu, 19 Oct 2017 16:01:06 +0500 Subject: [PATCH] Integrate Congress with OSA. - Tests minimum tempest's congress tests. Change-Id: Id0c4a4bb4c01757da671a495613141ad738573dd Signed-off-by: Taseer Ahmed --- ansible-role-requirements.yml | 4 ++ etc/openstack_deploy/conf.d/congress.yml.aio | 4 ++ etc/openstack_deploy/user_secrets.yml | 4 ++ inventory/env.d/congress.yml | 36 ++++++++++++ inventory/group_vars/congress_all.yml | 29 ++++++++++ .../repo_packages/openstack_services.yml | 6 ++ playbooks/os-congress-install.yml | 58 +++++++++++++++++++ playbooks/setup-openstack.yml | 2 +- tests/roles/bootstrap-host/defaults/main.yml | 3 + .../templates/user_variables_congress.yml.j2 | 21 +++++++ tests/test_inventory.py | 6 ++ tests/vars/bootstrap-aio-vars.yml | 6 ++ zuul.d/jobs.yaml | 8 +++ zuul.d/project.yaml | 3 +- 14 files changed, 188 insertions(+), 2 deletions(-) create mode 100644 etc/openstack_deploy/conf.d/congress.yml.aio create mode 100644 inventory/env.d/congress.yml create mode 100644 inventory/group_vars/congress_all.yml create mode 100644 playbooks/os-congress-install.yml create mode 100644 tests/roles/bootstrap-host/templates/user_variables_congress.yml.j2 diff --git a/ansible-role-requirements.yml b/ansible-role-requirements.yml index ebd214c3a5..4633cc04a9 100644 --- a/ansible-role-requirements.yml +++ b/ansible-role-requirements.yml @@ -70,6 +70,10 @@ scm: git src: https://git.openstack.org/openstack/openstack-ansible-os_cinder version: master +- name: os_congress + scm: git + src: https://git.openstack.org/openstack/openstack-ansible-os_congress + version: master - name: os_designate scm: git src: https://git.openstack.org/openstack/openstack-ansible-os_designate diff --git a/etc/openstack_deploy/conf.d/congress.yml.aio b/etc/openstack_deploy/conf.d/congress.yml.aio new file mode 100644 index 0000000000..c935150fc8 --- /dev/null +++ b/etc/openstack_deploy/conf.d/congress.yml.aio @@ -0,0 +1,4 @@ +--- +policy_hosts: + aio1: + ip: 172.29.236.100 \ No newline at end of file diff --git a/etc/openstack_deploy/user_secrets.yml b/etc/openstack_deploy/user_secrets.yml index d7d61cd3b3..6bedc47713 100644 --- a/etc/openstack_deploy/user_secrets.yml +++ b/etc/openstack_deploy/user_secrets.yml @@ -163,3 +163,7 @@ tacker_container_mysql_password: ## Ceph RadosGW Keystone password radosgw_admin_password: + +## Congress options +congress_container_mysql_password: +congress_service_password: diff --git a/inventory/env.d/congress.yml b/inventory/env.d/congress.yml new file mode 100644 index 0000000000..e72676f629 --- /dev/null +++ b/inventory/env.d/congress.yml @@ -0,0 +1,36 @@ +--- +# Copyright 2017, taseer94@gmail.com +# +# 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. + +component_skel: + congress_server: + belongs_to: + - congress_all + + +container_skel: + congress_container: + belongs_to: + - policy_containers + contains: + - congress_server + + +physical_skel: + policy_containers: + belongs_to: + - all_containers + policy_hosts: + belongs_to: + - hosts diff --git a/inventory/group_vars/congress_all.yml b/inventory/group_vars/congress_all.yml new file mode 100644 index 0000000000..3d8f5b9a12 --- /dev/null +++ b/inventory/group_vars/congress_all.yml @@ -0,0 +1,29 @@ +--- +# Copyright 2017, taseer94@gmail.com +# +# 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. + +congress_service_region: "{{ service_region }}" +congress_service_in_ldap: "{{ service_ldap_backend_enabled }}" + +# MariaDB details for the congress service +congress_galera_user: congress +congress_galera_database: congress +congress_galera_address: "{{ galera_address }}" + +# Ensure that the package state matches the global setting +congress_package_state: "{{ package_state }}" + +# venv fetch configuration +congress_venv_tag: "{{ venv_tag }}" +congress_venv_download_url: "{{ venv_base_download_url }}/congress-{{ openstack_release }}-{{ ansible_architecture | lower }}.tgz" diff --git a/playbooks/defaults/repo_packages/openstack_services.yml b/playbooks/defaults/repo_packages/openstack_services.yml index bcfaa23615..ecc18e1957 100644 --- a/playbooks/defaults/repo_packages/openstack_services.yml +++ b/playbooks/defaults/repo_packages/openstack_services.yml @@ -238,3 +238,9 @@ molteniron_git_project_group: molteniron_all tacker_git_repo: https://git.openstack.org/openstack/tacker tacker_git_install_branch: 1df345f8dc984d84df362980703616d78a3465b6 # HEAD of "master" as of 16.02.2018 tacker_git_project_group: tacker_all + + +## Congress service +congress_git_repo: https://git.openstack.org/openstack/congress +congress_git_install_branch: d3abc388515ba6456944093a6accde003dfea33f # HEAD of "master" as of 16.02.2018 +congress_git_project_group: congress_all \ No newline at end of file diff --git a/playbooks/os-congress-install.yml b/playbooks/os-congress-install.yml new file mode 100644 index 0000000000..ec1ce0b461 --- /dev/null +++ b/playbooks/os-congress-install.yml @@ -0,0 +1,58 @@ +--- +# Copyright 2017, taseer94@gmail.com +# +# 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: install congress components + hosts: congress_all + gather_facts: "{{ gather_facts | default(True) }}" + max_fail_percentage: 20 + user: root + pre_tasks: + - include: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" + - include: common-tasks/mysql-db-user.yml + vars: + user_name: "{{ congress_galera_user }}" + password: "{{ congress_container_mysql_password }}" + login_host: "{{ congress_galera_address }}" + db_name: "{{ congress_galera_database }}" + run_once: yes + + - name: Configure log directories (on metal) + include: common-tasks/os-log-dir-setup.yml + vars: + log_dirs: + - src: "/openstack/log/{{ inventory_hostname }}-congress" + dest: "/var/log/congress" + + - include: common-tasks/unbound-clients.yml + static: no + when: + - hostvars['localhost']['resolvconf_enabled'] | bool + + - name: Configure package proxy cache + include: common-tasks/package-cache-proxy.yml + roles: + - role: "os_congress" + - role: "openstack_openrc" + tags: + - openrc + - role: "rsyslog_client" + rsyslog_client_log_rotate_file: congress_log_rotate + rsyslog_client_log_dir: "/var/log/congress" + rsyslog_client_config_name: "99-congress-rsyslog-client.conf" + tags: + - rsyslog + - role: "system_crontab_coordination" + tags: + - crontab diff --git a/playbooks/setup-openstack.yml b/playbooks/setup-openstack.yml index 33bfa73f3c..5fe164cd42 100644 --- a/playbooks/setup-openstack.yml +++ b/playbooks/setup-openstack.yml @@ -44,7 +44,7 @@ # This is not an OpenStack service, but integrates with Keystone and must be # deployed afterward. - include: ceph-rgw-install.yml - +- include: os-congress-install.yml - include: os-tempest-install.yml when: (tempest_install | default(False)) | bool or (tempest_run | default(False)) | bool diff --git a/tests/roles/bootstrap-host/defaults/main.yml b/tests/roles/bootstrap-host/defaults/main.yml index 7ae79efa0c..5a9b76596e 100644 --- a/tests/roles/bootstrap-host/defaults/main.yml +++ b/tests/roles/bootstrap-host/defaults/main.yml @@ -47,6 +47,9 @@ bootstrap_user_variables_extra_templates: ceph: - src: user_variables_ceph.yml.j2 dest: user_variables_ceph.yml + congress: + - src: user_variables_congress.yml.j2 + dest: user_variables_congress.yml translations: - src: user_variables_translations.yml.j2 dest: user_variables_translations.yml diff --git a/tests/roles/bootstrap-host/templates/user_variables_congress.yml.j2 b/tests/roles/bootstrap-host/templates/user_variables_congress.yml.j2 new file mode 100644 index 0000000000..b2e4c67dcc --- /dev/null +++ b/tests/roles/bootstrap-host/templates/user_variables_congress.yml.j2 @@ -0,0 +1,21 @@ +# Copyright 2018, Taseer Ahmed +# +# 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. + +tempest_plugins: + - name: congress-tempest-plugin + repo: https://github.com/openstack/congress-tempest-plugin + branch: 15a14c3c8ee844db53571d28f86eafe8bc5fc02b # HEAD of "master" as of 16.02.2018 + +tempest_whitelist: + - congress_tempest_plugin.tests.scenario.test_congress_basic_ops \ No newline at end of file diff --git a/tests/test_inventory.py b/tests/test_inventory.py index b07bb6c134..9d7f02b24c 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -179,6 +179,9 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'compute_all', 'compute_containers', 'compute_hosts', + 'congress_all', + 'congress_container', + 'congress_server', 'dashboard_all', 'dashboard_containers', 'dashboard_hosts', @@ -280,6 +283,9 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'octavia-health-manager', 'octavia-infra_containers', 'octavia-infra_all', + 'policy_all', + 'policy_containers', + 'policy_hosts', 'powervm-compute_containers', 'powervm-compute_hosts', 'qemu-compute_containers', diff --git a/tests/vars/bootstrap-aio-vars.yml b/tests/vars/bootstrap-aio-vars.yml index 4bedcbe3ca..6f954a4396 100644 --- a/tests/vars/bootstrap-aio-vars.yml +++ b/tests/vars/bootstrap-aio-vars.yml @@ -52,6 +52,12 @@ confd_overrides: - name: keystone.yml.aio - name: neutron.yml.aio - name: nova.yml.aio + congress: + - name: haproxy.yml.aio + - name: nova.yml.aio + - name: neutron.yml.aio + - name: keystone.yml.aio + - name: congress.yml.aio translations: - name: haproxy.yml.aio - name: cinder.yml.aio diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index db473bdb94..c072c61ba3 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -112,6 +112,14 @@ action: deploy scenario: translations +- job: + name: openstack-ansible-deploy-congress-ubuntu-xenial + parent: openstack-ansible-deploy-aio_lxc-ubuntu-xenial + voting: false + vars: + action: deploy + scenario: congress + # centos - job: name: openstack-ansible-deploy-aio_lxc-centos-7 diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 73612d149c..6d96b83c76 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -33,6 +33,7 @@ - openstack-ansible-deploy-octavia-ubuntu-xenial - openstack-ansible-deploy_with_ansible_devel-aio-ubuntu-xenial - openstack-ansible-deploy-aio_nspawn-centos-7 + - openstack-ansible-deploy-congress-ubuntu-xenial gate: jobs: - openstack-ansible-linters @@ -51,4 +52,4 @@ - openstack-ansible-deploy-ceph-ubuntu-xenial - openstack-ansible-deploy-translations-ubuntu-xenial - openstack-ansible-upgrade-aio_lxc-ubuntu-xenial - - openstack-ansible-upgrade-ceph-ubuntu-xenial + - openstack-ansible-upgrade-ceph-ubuntu-xenial \ No newline at end of file