From 4f9e923ee60547cebb814551f65be65e1342a55f Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotjagov Date: Thu, 21 Mar 2019 16:02:17 +0200 Subject: [PATCH] Added Openstack Masakari role for the deployment This commit adds experimental deployment of Masakari role. It requires existing corosync/pacemaker cluster on compute nodes for hostmonitors to operate correctly. Corosync/pacemaker deployment stays out of OSA scope for now. Depends-On: Ib33d7bc83f1428763f873e1155fd9e3eb4c937e4 Change-Id: Ie543885a52f013635b9f553982c3d6448e3cc3aa --- ansible-role-requirements.yml | 5 ++ deploy-guide/source/configure.rst | 2 + .../contributor/role-maturity-matrix.html | 9 +++ etc/openstack_deploy/conf.d/masakari.yml.aio | 4 ++ .../conf.d/masakari.yml.example | 9 +++ .../env.d/aio_metal.yml.example | 3 + etc/openstack_deploy/user_secrets.yml | 5 ++ inventory/env.d/masakari.yml | 54 ++++++++++++++ inventory/group_vars/haproxy/haproxy.yml | 9 +++ inventory/group_vars/horizon_all.yml | 1 + inventory/inventory.ini | 8 +++ .../repo_packages/openstack_services.yml | 6 ++ playbooks/os-masakari-install.yml | 70 +++++++++++++++++++ playbooks/setup-openstack.yml | 1 + ...add-masakari-to-repo-40cce14de6f39670.yaml | 5 ++ tests/test_inventory.py | 11 +++ 16 files changed, 202 insertions(+) create mode 100644 etc/openstack_deploy/conf.d/masakari.yml.aio create mode 100644 etc/openstack_deploy/conf.d/masakari.yml.example create mode 100644 inventory/env.d/masakari.yml create mode 100644 playbooks/os-masakari-install.yml create mode 100644 releasenotes/notes/add-masakari-to-repo-40cce14de6f39670.yaml diff --git a/ansible-role-requirements.yml b/ansible-role-requirements.yml index 91d10ed6cf..6629d4fdce 100644 --- a/ansible-role-requirements.yml +++ b/ansible-role-requirements.yml @@ -138,6 +138,11 @@ src: https://git.openstack.org/openstack/openstack-ansible-os_magnum version: master trackbranch: master +- name: os_masakari + scm: git + src: https://git.openstack.org/openstack/openstack-ansible-os_masakari + version: master + trackbranch: master - name: os_mistral scm: git src: https://git.openstack.org/openstack/openstack-ansible-os_mistral diff --git a/deploy-guide/source/configure.rst b/deploy-guide/source/configure.rst index 87b5673f21..09ec363c53 100644 --- a/deploy-guide/source/configure.rst +++ b/deploy-guide/source/configure.rst @@ -152,6 +152,8 @@ OpenStack service roles - :role_docs:`os_magnum` +- :role_docs:`os_masakari` + - :role_docs:`os_neutron` - :role_docs:`os_nova` diff --git a/doc/source/contributor/role-maturity-matrix.html b/doc/source/contributor/role-maturity-matrix.html index 52904d46bd..b8ee73dec4 100644 --- a/doc/source/contributor/role-maturity-matrix.html +++ b/doc/source/contributor/role-maturity-matrix.html @@ -243,6 +243,15 @@ ✔ ✔ + + os_masakari + Stein + Incubated + ✔ + ✔ + ✔ + ✔ + os_molteniron Pike diff --git a/etc/openstack_deploy/conf.d/masakari.yml.aio b/etc/openstack_deploy/conf.d/masakari.yml.aio new file mode 100644 index 0000000000..02eb4b6a40 --- /dev/null +++ b/etc/openstack_deploy/conf.d/masakari.yml.aio @@ -0,0 +1,4 @@ +--- +masakari-infra_hosts: + aio1: + ip: 172.29.236.100 \ No newline at end of file diff --git a/etc/openstack_deploy/conf.d/masakari.yml.example b/etc/openstack_deploy/conf.d/masakari.yml.example new file mode 100644 index 0000000000..07d9b04645 --- /dev/null +++ b/etc/openstack_deploy/conf.d/masakari.yml.example @@ -0,0 +1,9 @@ +--- +# The infra nodes that will be running the masakari services +masakari-infra_hosts: + infra1: + ip: 172.20.236.111 + infra2: + ip: 172.20.236.112 + infra3: + ip: 172.20.236.113 \ No newline at end of file diff --git a/etc/openstack_deploy/env.d/aio_metal.yml.example b/etc/openstack_deploy/env.d/aio_metal.yml.example index 6a935ab9c3..96f118b785 100644 --- a/etc/openstack_deploy/env.d/aio_metal.yml.example +++ b/etc/openstack_deploy/env.d/aio_metal.yml.example @@ -72,6 +72,9 @@ container_skel: magnum_container: properties: is_metal: true + masakari_monitors_container: + properties: + is_metal: true memcached_container: properties: is_metal: true diff --git a/etc/openstack_deploy/user_secrets.yml b/etc/openstack_deploy/user_secrets.yml index 6384181130..a2246f313b 100644 --- a/etc/openstack_deploy/user_secrets.yml +++ b/etc/openstack_deploy/user_secrets.yml @@ -192,6 +192,11 @@ magnum_oslomsg_rpc_password: #magnum_oslomsg_notify_password: magnum_trustee_password: +## Masakari Options +masakari_service_password: +masakari_oslomsg_rpc_password: +masakari_container_mysql_password: + # Mistral Options mistral_service_password: mistral_galera_password: diff --git a/inventory/env.d/masakari.yml b/inventory/env.d/masakari.yml new file mode 100644 index 0000000000..0c6c923232 --- /dev/null +++ b/inventory/env.d/masakari.yml @@ -0,0 +1,54 @@ +--- +# Copyright 2014, 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. + +component_skel: + masakari_engine: + belongs_to: + - masakari_all + masakari_api: + belongs_to: + - masakari_all + masakari_monitor: + belongs_to: + - masakari_all + +container_skel: + masakari_api_container: + belongs_to: + - masakari-infra_containers + contains: + - masakari_engine + - masakari_api + masakari_monitors_container: + belongs_to: + - masakari-monitor_containers + contains: + - masakari_monitor + properties: + is_metal: true + +physical_skel: + masakari-monitor_containers: + belongs_to: + - all_containers + masakari-monitor_hosts: + belongs_to: + - hosts + masakari-infra_containers: + belongs_to: + - all_containers + masakari-infra_hosts: + belongs_to: + - hosts \ No newline at end of file diff --git a/inventory/group_vars/haproxy/haproxy.yml b/inventory/group_vars/haproxy/haproxy.yml index 0b571adeeb..14ffa05084 100644 --- a/inventory/group_vars/haproxy/haproxy.yml +++ b/inventory/group_vars/haproxy/haproxy.yml @@ -266,6 +266,15 @@ haproxy_default_services: haproxy_backend_options: - "httpchk GET / HTTP/1.0\\r\\nUser-agent:\\ osa-haproxy-healthcheck" haproxy_service_enabled: "{{ groups['magnum_all'] is defined and groups['magnum_all'] | length > 0 }}" + - service: + haproxy_service_name: masakari_api + haproxy_backend_nodes: "{{ groups['masakari_api'] | default([]) }}" + haproxy_ssl: "{{ haproxy_ssl }}" + haproxy_port: 15868 + haproxy_balance_type: http + haproxy_backend_options: + - "httpchk GET / HTTP/1.0\\r\\nUser-agent:\\ osa-haproxy-healthcheck" + haproxy_service_enabled: "{{ groups['masakari_api'] is defined and groups['masakari_api'] | length > 0 }}" - service: haproxy_service_name: mistral haproxy_backend_nodes: "{{ groups['mistral_all'] | default([]) }}" diff --git a/inventory/group_vars/horizon_all.yml b/inventory/group_vars/horizon_all.yml index 477c08bd61..c5938cbdcc 100644 --- a/inventory/group_vars/horizon_all.yml +++ b/inventory/group_vars/horizon_all.yml @@ -19,6 +19,7 @@ horizon_enable_cinder_backup: "{{ hostvars['localhost']['cinder_service_backup_p horizon_enable_heat_ui: "{{ (groups['heat_all'] is defined) and (groups['heat_all'] | length > 0) }}" horizon_enable_ironic_ui: "{{ (groups['ironic_all'] is defined) and (groups['ironic_all'] | length > 0) }}" horizon_enable_magnum_ui: "{{ (groups['magnum_all'] is defined) and (groups['magnum_all'] | length > 0) }}" +horizon_enable_masakari_ui: "{{ (groups['masakari_all'] is defined) and (groups['masakari_all'] | length > 0) }}" horizon_enable_designate_ui: "{{ (groups['designate_all'] is defined) and (groups['designate_all'] | length > 0) }}" horizon_enable_octavia_ui: "{{ (groups['octavia-infra_all'] is defined) and (groups['octavia-infra_all'] | length > 0) }}" # NOTE(mhayden): neutron-lbaas is a separate plugin and requires the full diff --git a/inventory/inventory.ini b/inventory/inventory.ini index 7a24afc544..3e913e251a 100644 --- a/inventory/inventory.ini +++ b/inventory/inventory.ini @@ -135,6 +135,14 @@ ironic_server [magnum_all] +[masakari_all:children] +masakari_api +masakari_engine +masakari_monitor +[masakari_api] +[masakari_engine] +[masakari_monitor] + [mistral_all:children] mistral_api mistral_engine diff --git a/playbooks/defaults/repo_packages/openstack_services.yml b/playbooks/defaults/repo_packages/openstack_services.yml index 0555f3a7c6..fab1b6c6fb 100644 --- a/playbooks/defaults/repo_packages/openstack_services.yml +++ b/playbooks/defaults/repo_packages/openstack_services.yml @@ -256,6 +256,12 @@ magnum_git_install_branch: f1f96e58358aaf56adf4d299665501141c798fa4 # HEAD as of magnum_git_project_group: magnum_all magnum_git_track_branch: master +## Masakari service +masakari_git_repo: https://git.openstack.org/openstack/masakari +masakari_git_install_branch: d73a88a9c42fd3e70b291913cec0a61fa5654117 # HEAD as of 23.03.2019 +masakari_git_project_group: masakari_all +masakari_git_track_branch: master + ## Mistral service mistral_git_repo: https://git.openstack.org/openstack/mistral mistral_git_install_branch: 3e42cffd6c9494ffab13a2504ee6370232a0ef4d # HEAD as of 23.03.2019 diff --git a/playbooks/os-masakari-install.yml b/playbooks/os-masakari-install.yml new file mode 100644 index 0000000000..8d5029d516 --- /dev/null +++ b/playbooks/os-masakari-install.yml @@ -0,0 +1,70 @@ +--- +# Copyright 2014, 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: Install the masakari components + hosts: masakari_all + gather_facts: "{{ osa_gather_facts | default(True) }}" + user: root + vars_files: + - "defaults/repo_packages/openstack_services.yml" + - "defaults/{{ install_method }}_install.yml" + pre_tasks: + # In order to ensure that any container, software or + # config file changes which causes a container/service + # restart do not cause an unexpected outage, we drain + # the load balancer back end for this container. + - include_tasks: common-tasks/haproxy-endpoint-manage.yml + vars: + haproxy_backend: masakari_api-back + haproxy_state: disabled + when: + - "'masakari_api' in group_names" + - "groups['masakari_api'] | length > 1" + + - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" + when: not is_metal + + - include_tasks: common-tasks/os-log-dir-setup.yml + vars: + log_dirs: + - src: "/openstack/log/{{ inventory_hostname }}-masakari" + dest: "/var/log/masakari" + - include_tasks: common-tasks/unbound-clients.yml + when: + - hostvars['localhost']['resolvconf_enabled'] | bool + + roles: + - role: "os_masakari" + + post_tasks: + - include_tasks: "common-tasks/rsyslog-client.yml" + vars: + rsyslog_client_log_rotate_file: masakari_log_rotate + rsyslog_client_log_dir: "/var/log/masakari" + rsyslog_client_config_name: "99-masakari-rsyslog-client.conf" + # Now that container changes are done, we can set + # the load balancer back end for this container + # to available again. + - include_tasks: common-tasks/haproxy-endpoint-manage.yml + vars: + haproxy_backend: masakari_api-back + haproxy_state: enabled + when: + - "'masakari_api' in group_names" + - "groups['masakari_api'] | length > 1" + + environment: "{{ deployment_environment_variables | default({}) }}" + tags: + - masakari diff --git a/playbooks/setup-openstack.yml b/playbooks/setup-openstack.yml index de55b26a1c..4d19711a59 100644 --- a/playbooks/setup-openstack.yml +++ b/playbooks/setup-openstack.yml @@ -33,6 +33,7 @@ - import_playbook: os-octavia-install.yml - import_playbook: os-tacker-install.yml - import_playbook: os-blazar-install.yml +- import_playbook: os-masakari-install.yml # This is not an OpenStack service, but integrates with Keystone and must be # deployed afterward. diff --git a/releasenotes/notes/add-masakari-to-repo-40cce14de6f39670.yaml b/releasenotes/notes/add-masakari-to-repo-40cce14de6f39670.yaml new file mode 100644 index 0000000000..962a953439 --- /dev/null +++ b/releasenotes/notes/add-masakari-to-repo-40cce14de6f39670.yaml @@ -0,0 +1,5 @@ +--- +features: + - Experimental support has been added to allow the deployment of the + OpenStack Masakari service when hosts are present in the host group + ``masakari-infra_hosts``. diff --git a/tests/test_inventory.py b/tests/test_inventory.py index 5f0ecb28ab..45d424cb55 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -275,6 +275,17 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'magnum-infra_hosts', 'magnum_all', 'magnum_container', + 'masakari_all', + 'masakari_api', + 'masakari_api_container', + 'masakari_engine', + 'masakari-infra_all', + 'masakari-infra_containers', + 'masakari-infra_hosts', + 'masakari_monitor', + 'masakari-monitor_containers', + 'masakari_monitors_container', + 'masakari-monitor_hosts', 'mistral-infra_all', 'mistral-infra_containers', 'mistral-infra_hosts',