From 3214d6fbc3d834563c92fc0c78e0bd258724f09a Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 2 Sep 2020 18:44:03 +0300 Subject: [PATCH] Added Openstack Senlin role deployment This commit adds experimental deployment of Senlin role. Change-Id: I1e116518ec437c1634ea9d40172e424c73da56d5 --- ansible-role-requirements.yml | 5 ++ deploy-guide/source/configure.rst | 2 + .../contributor/role-maturity-matrix.html | 11 +++- etc/openstack_deploy/conf.d/senlin.yml.aio | 4 ++ .../conf.d/senlin.yml.example | 8 +++ etc/openstack_deploy/user_secrets.yml | 7 +++ inventory/env.d/senlin.yml | 31 ++++++++++ inventory/group_vars/haproxy/haproxy.yml | 10 +++ inventory/group_vars/horizon_all.yml | 1 + inventory/inventory.ini | 10 +++ .../repo_packages/openstack_services.yml | 7 +++ playbooks/os-senlin-install.yml | 62 +++++++++++++++++++ playbooks/setup-openstack.yml | 1 + .../notes/os_senlin-c0b802950e22d55c.yaml | 6 ++ tests/test_inventory.py | 9 +++ zuul.d/jobs.yaml | 2 + 16 files changed, 175 insertions(+), 1 deletion(-) create mode 100644 etc/openstack_deploy/conf.d/senlin.yml.aio create mode 100644 etc/openstack_deploy/conf.d/senlin.yml.example create mode 100644 inventory/env.d/senlin.yml create mode 100644 playbooks/os-senlin-install.yml create mode 100644 releasenotes/notes/os_senlin-c0b802950e22d55c.yaml diff --git a/ansible-role-requirements.yml b/ansible-role-requirements.yml index 949d90b9bb..35ff7d7090 100644 --- a/ansible-role-requirements.yml +++ b/ansible-role-requirements.yml @@ -188,6 +188,11 @@ src: https://opendev.org/openstack/openstack-ansible-os_sahara version: master trackbranch: master +- name: os_senlin + scm: git + src: https://opendev.org/openstack/openstack-ansible-os_senlin + version: master + trackbranch: master - name: os_swift scm: git src: https://opendev.org/openstack/openstack-ansible-os_swift diff --git a/deploy-guide/source/configure.rst b/deploy-guide/source/configure.rst index c606daf72d..58776303ab 100644 --- a/deploy-guide/source/configure.rst +++ b/deploy-guide/source/configure.rst @@ -166,6 +166,8 @@ OpenStack service roles - :role_docs:`os_sahara` +- :role_docs:`os_senlin` + - :role_docs:`os_swift` - :role_docs:`os_tempest` diff --git a/doc/source/contributor/role-maturity-matrix.html b/doc/source/contributor/role-maturity-matrix.html index af3d4d1d07..8d4187759a 100644 --- a/doc/source/contributor/role-maturity-matrix.html +++ b/doc/source/contributor/role-maturity-matrix.html @@ -291,7 +291,7 @@ os_panko Rocky - Inclubated + Incubated ✔ ✔ ✘ @@ -315,6 +315,15 @@ ✔ ✔ + + os_senlin + Ussuri + Inclubated + ✔ + ✔ + ✔ + ✔ + os_swift Mitaka diff --git a/etc/openstack_deploy/conf.d/senlin.yml.aio b/etc/openstack_deploy/conf.d/senlin.yml.aio new file mode 100644 index 0000000000..6a6b428103 --- /dev/null +++ b/etc/openstack_deploy/conf.d/senlin.yml.aio @@ -0,0 +1,4 @@ +# The controller host that the senlin control plane will be run on +senlin-infra_hosts: + aio1: + ip: 172.29.236.100 diff --git a/etc/openstack_deploy/conf.d/senlin.yml.example b/etc/openstack_deploy/conf.d/senlin.yml.example new file mode 100644 index 0000000000..192ee8ad00 --- /dev/null +++ b/etc/openstack_deploy/conf.d/senlin.yml.example @@ -0,0 +1,8 @@ +# The infra nodes that will be running the senlin services +senlin-infra_hosts: + infra1: + ip: 172.20.236.111 + infra2: + ip: 172.20.236.112 + infra3: + ip: 172.20.236.113 diff --git a/etc/openstack_deploy/user_secrets.yml b/etc/openstack_deploy/user_secrets.yml index 7af295aad9..f06a842791 100644 --- a/etc/openstack_deploy/user_secrets.yml +++ b/etc/openstack_deploy/user_secrets.yml @@ -163,6 +163,13 @@ sahara_oslomsg_rpc_password: #sahara_oslomsg_notify_password: sahara_service_password: + +## Senlin Options: +senlin_galera_password: +senlin_oslomsg_rpc_password: +senlin_service_password: + + ## Swift Options: swift_service_password: swift_dispersion_password: diff --git a/inventory/env.d/senlin.yml b/inventory/env.d/senlin.yml new file mode 100644 index 0000000000..924f46f3ea --- /dev/null +++ b/inventory/env.d/senlin.yml @@ -0,0 +1,31 @@ +component_skel: + senlin_api: + belongs_to: + - senlin_all + senlin_engine: + belongs_to: + - senlin_all + senlin_conductor: + belongs_to: + - senlin_all + senlin_health_manager: + belongs_to: + - senlin_all + +container_skel: + senlin_container: + belongs_to: + - senlin-infra_containers + contains: + - senlin_api + - senlin_engine + - senlin_conductor + - senlin_health_manager + +physical_skel: + senlin-infra_containers: + belongs_to: + - all_containers + senlin-infra_hosts: + belongs_to: + - hosts diff --git a/inventory/group_vars/haproxy/haproxy.yml b/inventory/group_vars/haproxy/haproxy.yml index 50133e5644..ac9f88fa02 100644 --- a/inventory/group_vars/haproxy/haproxy.yml +++ b/inventory/group_vars/haproxy/haproxy.yml @@ -227,6 +227,16 @@ haproxy_default_services: haproxy_backend_options: - "httpchk GET /healthcheck HTTP/1.0\\r\\nUser-agent:\\ osa-haproxy-healthcheck" haproxy_service_enabled: "{{ groups['sahara_api'] is defined and groups['sahara_api'] | length > 0 }}" + - service: + haproxy_service_name: senlin_api + haproxy_backend_nodes: "{{ groups['senlin_api'] | default([]) }}" + haproxy_ssl: "{{ haproxy_ssl }}" + haproxy_ssl_all_vips: "{{ haproxy_ssl_all_vips }}" + haproxy_port: 8778 + haproxy_balance_type: http + haproxy_backend_options: + - "httpchk GET / HTTP/1.0\\r\\nUser-agent:\\ osa-haproxy-healthcheck" + haproxy_service_enabled: "{{ groups['senlin_api'] is defined and groups['senlin_api'] | length > 0 }}" - service: haproxy_service_name: swift_proxy haproxy_backend_nodes: "{{ groups['swift_proxy'] | default([]) }}" diff --git a/inventory/group_vars/horizon_all.yml b/inventory/group_vars/horizon_all.yml index df91cfe3bf..eb93d7a734 100644 --- a/inventory/group_vars/horizon_all.yml +++ b/inventory/group_vars/horizon_all.yml @@ -28,6 +28,7 @@ horizon_enable_designate_ui: "{{ (groups['designate_all'] is defined) and (group horizon_enable_octavia_ui: "{{ (groups['octavia-infra_all'] is defined) and (groups['octavia-infra_all'] | length > 0) }}" horizon_enable_neutron_fwaas: "{{ neutron_plugin_base is defined and (neutron_plugin_base | intersect(['firewall', 'firewall_v2']) | length > 0) }}" horizon_enable_neutron_vpnaas: "{{ neutron_plugin_base is defined and 'vpnaas' in neutron_plugin_base }}" +horizon_enable_senlin_ui: "{{ (groups['senlin_all'] is defined) and (groups['senlin_all'] | length > 0) }}" horizon_enable_ha_router: "{{ neutron_plugin_type.split('.')[0] == 'ml2' and (groups['neutron_l3_agent'] | length >= 2) }}" # Ensure that the package state matches the global setting diff --git a/inventory/inventory.ini b/inventory/inventory.ini index b0f8ff331b..52363a000c 100644 --- a/inventory/inventory.ini +++ b/inventory/inventory.ini @@ -230,6 +230,16 @@ sahara_engine [sahara_api] [sahara_engine] +[senlin_all:children] +senlin_api +senlin_engine +senlin_conductor +senlin_health_manager +[senlin_api] +[senlin_engine] +[senlin_conductor] +[senlin_health_manager] + [swift_all:children] swift_acc swift_cont diff --git a/playbooks/defaults/repo_packages/openstack_services.yml b/playbooks/defaults/repo_packages/openstack_services.yml index ba9e5f14b3..3dcc220ff5 100644 --- a/playbooks/defaults/repo_packages/openstack_services.yml +++ b/playbooks/defaults/repo_packages/openstack_services.yml @@ -205,6 +205,13 @@ sahara_git_project_group: sahara_all sahara_git_track_branch: master +## Senlin service +senlin_git_repo: https://opendev.org/openstack/senlin +senlin_git_install_branch: 585bd14c70415b63265321cc7728b4e8c50702a7 # HEAD as of 02.09.2020 +senlin_git_project_group: senlin_all +senlin_git_track_branch: master + + ## Swift service swift_git_repo: https://opendev.org/openstack/swift swift_git_install_branch: 0fa259e7beecaf0dd8e3d342ffbf1ec4a2b23864 # HEAD as of 23.08.2020 diff --git a/playbooks/os-senlin-install.yml b/playbooks/os-senlin-install.yml new file mode 100644 index 0000000000..e260079428 --- /dev/null +++ b/playbooks/os-senlin-install.yml @@ -0,0 +1,62 @@ +--- +# Copyright 2020, City Network International AB +# +# 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: Gather senlin facts + hosts: senlin_all + gather_facts: "{{ osa_gather_facts | default(True) }}" + tags: + - always + +- name: Install senlin services + hosts: senlin_all + gather_facts: false + user: root + environment: "{{ deployment_environment_variables | default({}) }}" + vars_files: + - "defaults/repo_packages/openstack_services.yml" + - "defaults/{{ install_method }}_install.yml" + tags: + - senlin + 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: senlin_api-back + haproxy_state: disabled + when: + - "'senlin_api' in group_names" + - "groups['senlin_api'] | length > 1" + + - include_tasks: common-tasks/unbound-clients.yml + when: + - hostvars['localhost']['resolvconf_enabled'] | bool + + roles: + - role: "os_senlin" + + post_tasks: + # 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: senlin_api-back + haproxy_state: enabled + when: + - "'senlin_api' in group_names" + - "groups['senlin_api'] | length > 1" diff --git a/playbooks/setup-openstack.yml b/playbooks/setup-openstack.yml index dea41683fe..601fc260cc 100644 --- a/playbooks/setup-openstack.yml +++ b/playbooks/setup-openstack.yml @@ -32,6 +32,7 @@ - import_playbook: os-magnum-install.yml - import_playbook: os-trove-install.yml - import_playbook: os-sahara-install.yml +- import_playbook: os-senlin-install.yml - import_playbook: os-octavia-install.yml - import_playbook: os-tacker-install.yml - import_playbook: os-blazar-install.yml diff --git a/releasenotes/notes/os_senlin-c0b802950e22d55c.yaml b/releasenotes/notes/os_senlin-c0b802950e22d55c.yaml new file mode 100644 index 0000000000..22de5e41e2 --- /dev/null +++ b/releasenotes/notes/os_senlin-c0b802950e22d55c.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Experimental support has been added to allow the deployment of the + OpenStack Senlin service when hosts are present in the host group + ``senlin-infra_hosts``. diff --git a/tests/test_inventory.py b/tests/test_inventory.py index 8136a13375..0f488a573c 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -450,6 +450,15 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'sahara_api', 'sahara_container', 'sahara_engine', + 'senlin-infra_all', + 'senlin-infra_containers', + 'senlin-infra_hosts', + 'senlin_all', + 'senlin_api', + 'senlin_container', + 'senlin_engine', + 'senlin_conductor', + 'senlin_health_manager', 'shared-infra_all', 'shared-infra_containers', 'shared-infra_hosts', diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index bb5bb366e5..dd73f34a1b 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -60,6 +60,7 @@ - name: openstack/openstack-ansible-os_placement - name: openstack/openstack-ansible-os_rally - name: openstack/openstack-ansible-os_sahara + - name: openstack/openstack-ansible-os_senlin - name: openstack/openstack-ansible-os_swift - name: openstack/openstack-ansible-os_tacker - name: openstack/openstack-ansible-os_tempest @@ -107,6 +108,7 @@ - name: openstack/networking-sfc - name: openstack/nova - name: openstack/sahara + - name: openstack/senlin - name: openstack/swift - name: openstack/ironic - name: openstack/ironic-inspector