From df54583ca78a97d3b40033618d683112c20ac20e Mon Sep 17 00:00:00 2001 From: Taseer Ahmed Date: Tue, 6 Mar 2018 11:01:15 +0500 Subject: [PATCH] Integrate Blazar with OpenStack Ansible Change-Id: I27874f755bcef493165877a24e284c493d99cb2a --- ansible-role-requirements.yml | 4 ++ etc/openstack_deploy/conf.d/blazar.yml.aio | 4 ++ etc/openstack_deploy/user_secrets.yml | 10 ++++ inventory/env.d/blazar.yml | 39 +++++++++++++ inventory/group_vars/blazar_all.yml | 20 +++++++ inventory/inventory.ini | 8 +++ .../repo_packages/openstack_services.yml | 12 ++++ playbooks/os-blazar-install.yml | 55 +++++++++++++++++++ playbooks/setup-openstack.yml | 1 + tests/test_inventory.py | 7 +++ tests/vars/bootstrap-aio-vars.yml | 7 +++ zuul.d/jobs.yaml | 7 +++ zuul.d/project-templates.yaml | 1 + 13 files changed, 175 insertions(+) create mode 100644 etc/openstack_deploy/conf.d/blazar.yml.aio create mode 100644 inventory/env.d/blazar.yml create mode 100644 inventory/group_vars/blazar_all.yml create mode 100644 playbooks/os-blazar-install.yml diff --git a/ansible-role-requirements.yml b/ansible-role-requirements.yml index c08692f793..a4b16194d8 100644 --- a/ansible-role-requirements.yml +++ b/ansible-role-requirements.yml @@ -62,6 +62,10 @@ scm: git src: https://git.openstack.org/openstack/openstack-ansible-os_barbican version: master +- name: os_blazar + scm: git + src: https://git.openstack.org/openstack/openstack-ansible-os_blazar + version: master - name: os_ceilometer scm: git src: https://git.openstack.org/openstack/openstack-ansible-os_ceilometer diff --git a/etc/openstack_deploy/conf.d/blazar.yml.aio b/etc/openstack_deploy/conf.d/blazar.yml.aio new file mode 100644 index 0000000000..48756d0b97 --- /dev/null +++ b/etc/openstack_deploy/conf.d/blazar.yml.aio @@ -0,0 +1,4 @@ +--- +reservation_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 e223e7bd49..dac465cc24 100644 --- a/etc/openstack_deploy/user_secrets.yml +++ b/etc/openstack_deploy/user_secrets.yml @@ -218,6 +218,16 @@ barbican_oslomsg_rpc_password: #barbican_oslomsg_notify_password: barbican_service_password: +## Blazar Options +blazar_oslomsg_rpc_password: +#NOTE: Please uncomment those +# if you want to split rpc and notify users +# Please also wire the appropriate userid in +# your variables +#blazar_oslomsg_notify_password: +blazar_service_password: +blazar_container_mysql_password: + ## Designate Options designate_galera_password: designate_oslomsg_rpc_password: diff --git a/inventory/env.d/blazar.yml b/inventory/env.d/blazar.yml new file mode 100644 index 0000000000..c826f0d728 --- /dev/null +++ b/inventory/env.d/blazar.yml @@ -0,0 +1,39 @@ +--- +# Copyright 2018, 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: + blazar_api: + belongs_to: + - blazar_all + blazar_manager: + belongs_to: + - blazar_all + + +container_skel: + blazar_container: + belongs_to: + - reservation_containers + contains: + - blazar_api + - blazar_manager + +physical_skel: + reservation_containers: + belongs_to: + - all_containers + reservation_hosts: + belongs_to: + - hosts diff --git a/inventory/group_vars/blazar_all.yml b/inventory/group_vars/blazar_all.yml new file mode 100644 index 0000000000..e5174fdb7b --- /dev/null +++ b/inventory/group_vars/blazar_all.yml @@ -0,0 +1,20 @@ +--- +# Copyright 2018, 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. + +blazar_service_region: "{{ service_region }}" +blazar_service_in_ldap: "{{ service_ldap_backend_enabled }}" + +# Ensure that the package state matches the global setting +blazar_package_state: "{{ package_state }}" diff --git a/inventory/inventory.ini b/inventory/inventory.ini index df0deb4cf9..cea2cd4627 100644 --- a/inventory/inventory.ini +++ b/inventory/inventory.ini @@ -42,6 +42,14 @@ aodh_listener [barbican_all] +[blazar_all:children] +blazar_api +blazar_manager + +[blazar_api] + +[blazar_manager] + [ceilometer_all:children] ceilometer_agent_central ceilometer_agent_compute diff --git a/playbooks/defaults/repo_packages/openstack_services.yml b/playbooks/defaults/repo_packages/openstack_services.yml index d4d9e6bec4..d0736fa467 100644 --- a/playbooks/defaults/repo_packages/openstack_services.yml +++ b/playbooks/defaults/repo_packages/openstack_services.yml @@ -294,3 +294,15 @@ octavia_dashboard_git_install_branch: 4f7a5591ae8dd61b25af7f746f20d8f058aa991c # octavia_dashboard_git_project_group: horizon_all octavia_dashboard_git_track_branch: master + +## Blazar service +blazar_git_repo: https://git.openstack.org/openstack/blazar +blazar_git_install_branch: 3cdd01a3cd5235489b290a3eeb5f4af8301adf60 # HEAD of "master" as of 08.08.2018 +blazar_git_project_group: blazar_all +blazar_git_track_branch: master + +## Blazar Nova Service +blazar_nova_git_repo: https://git.openstack.org/openstack/blazar-nova +blazar_nova_git_intall: 67f04e32cc7d701ee60132645cf5cd1258fe1722 # HEAD of "master" as of 08.08.2018 +blazar_nova_project_group: blazar_all +blazar_nova_git_track_branch: master \ No newline at end of file diff --git a/playbooks/os-blazar-install.yml b/playbooks/os-blazar-install.yml new file mode 100644 index 0000000000..9d73c38192 --- /dev/null +++ b/playbooks/os-blazar-install.yml @@ -0,0 +1,55 @@ +--- +# Copyright 2018, 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 blazar components + hosts: blazar_all + gather_facts: "{{ osa_gather_facts | default(True) }}" + environment: "{{ deployment_environment_variables | default({}) }}" + user: root + vars_files: + - "defaults/{{ install_method }}_install.yml" + tags: + - blazar + pre_tasks: + - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" + when: not is_metal + + - name: Configure log directories (on metal) + include_tasks: common-tasks/os-log-dir-setup.yml + vars: + log_dirs: + - src: "/openstack/log/{{ inventory_hostname }}-blazar" + dest: "/var/log/blazar" + + - include_tasks: common-tasks/unbound-clients.yml + when: + - hostvars['localhost']['resolvconf_enabled'] | bool + + - name: Configure package proxy cache + include_tasks: common-tasks/package-cache-proxy.yml + when: install_method == "source" + + roles: + - role: "os_blazar" + - role: "system_crontab_coordination" + tags: + - crontab + + post_tasks: + - include_tasks: "common-tasks/rsyslog-client.yml" + vars: + rsyslog_client_log_rotate_file: blazar_log_rotate + rsyslog_client_log_dir: "/var/log/blazar" + rsyslog_client_config_name: "99-blazar-rsyslog-client.conf" diff --git a/playbooks/setup-openstack.yml b/playbooks/setup-openstack.yml index 63ebca5105..a4dacd1f47 100644 --- a/playbooks/setup-openstack.yml +++ b/playbooks/setup-openstack.yml @@ -39,6 +39,7 @@ - include: os-sahara-install.yml - include: os-octavia-install.yml - include: os-tacker-install.yml +- include: os-blazar-install.yml # This is not an OpenStack service, but integrates with Keystone and must be # deployed afterward. diff --git a/tests/test_inventory.py b/tests/test_inventory.py index 3db6df21b5..7745ffc8d1 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -145,6 +145,10 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'barbican_all', 'barbican_api', 'barbican_container', + 'blazar_all', + 'blazar_container', + 'blazar_api', + 'blazar_manager', 'ceilometer_all', 'ceilometer_agent_central', 'ceilometer_agent_compute', @@ -291,6 +295,9 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'powervm-compute_hosts', 'qemu-compute_containers', 'qemu-compute_hosts', + 'reservation_all', + 'reservation_containers', + 'reservation_hosts', 'trove_all', 'trove_api', 'trove_conductor', diff --git a/tests/vars/bootstrap-aio-vars.yml b/tests/vars/bootstrap-aio-vars.yml index 87b9466cf8..f769f11fc9 100644 --- a/tests/vars/bootstrap-aio-vars.yml +++ b/tests/vars/bootstrap-aio-vars.yml @@ -36,6 +36,13 @@ confd_overrides: - name: keystone.yml.aio - name: neutron.yml.aio - name: nova.yml.aio + blazar: + - name: haproxy.yml.aio + - name: nova.yml.aio + - name: neutron.yml.aio + - name: keystone.yml.aio + - name: glance.yml.aio + - name: blazar.yml.aio ceph: - name: haproxy.yml.aio - name: ceph.yml.aio diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 1d51fa3de3..fa0764a0b1 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -166,6 +166,13 @@ action: deploy scenario: barbican +- job: + name: openstack-ansible-deploy-blazar-ubuntu-bionic + parent: openstack-ansible-deploy-aio_lxc-ubuntu-bionic + vars: + action: deploy + scenario: blazar + # centos - job: name: openstack-ansible-deploy-aio_lxc-centos-7 diff --git a/zuul.d/project-templates.yaml b/zuul.d/project-templates.yaml index 7564dd3dd4..09ea47cc8e 100644 --- a/zuul.d/project-templates.yaml +++ b/zuul.d/project-templates.yaml @@ -33,6 +33,7 @@ - openstack-ansible-deploy-octavia-ubuntu-bionic - openstack-ansible-deploy_with_ansible_devel-aio-ubuntu-bionic - openstack-ansible-deploy_with_ansible_next-aio-ubuntu-bionic + - openstack-ansible-deploy-blazar-ubuntu-bionic - project-template: name: openstack-ansible-deploy-aio_lxc-jobs