From 2302883430b43e5c26388a058909a20a003ccf04 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Wed, 8 Nov 2023 16:10:53 +0000 Subject: [PATCH] Use haproxy_service_setup playbook from plugins collection Move the common playbook to the OSA plugins collection and use it from there. Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/900431 Change-Id: I34c4900cf34635e46b8faec06dfc7cd24885eb3d --- .../haproxy-service-config.yml | 43 ------------------- playbooks/galera-install.yml | 2 +- playbooks/os-adjutant-install.yml | 2 +- playbooks/os-aodh-install.yml | 2 +- playbooks/os-barbican-install.yml | 2 +- playbooks/os-blazar-install.yml | 2 +- playbooks/os-cinder-install.yml | 2 +- playbooks/os-cloudkitty-install.yml | 2 +- playbooks/os-designate-install.yml | 2 +- playbooks/os-glance-install.yml | 2 +- playbooks/os-gnocchi-install.yml | 2 +- playbooks/os-heat-install.yml | 2 +- playbooks/os-horizon-install.yml | 2 +- playbooks/os-ironic-install.yml | 2 +- playbooks/os-keystone-install.yml | 2 +- playbooks/os-magnum-install.yml | 2 +- playbooks/os-manila-install.yml | 2 +- playbooks/os-masakari-install.yml | 2 +- playbooks/os-mistral-install.yml | 2 +- playbooks/os-murano-install.yml | 2 +- playbooks/os-neutron-install.yml | 2 +- playbooks/os-nova-install.yml | 2 +- playbooks/os-octavia-install.yml | 2 +- playbooks/os-placement-install.yml | 2 +- playbooks/os-sahara-install.yml | 2 +- playbooks/os-senlin-install.yml | 2 +- playbooks/os-swift-install.yml | 2 +- playbooks/os-tacker-install.yml | 2 +- playbooks/os-trove-install.yml | 2 +- playbooks/os-zun-install.yml | 2 +- playbooks/rabbitmq-install.yml | 2 +- playbooks/repo-install.yml | 2 +- 32 files changed, 31 insertions(+), 74 deletions(-) delete mode 100644 playbooks/common-playbooks/haproxy-service-config.yml diff --git a/playbooks/common-playbooks/haproxy-service-config.yml b/playbooks/common-playbooks/haproxy-service-config.yml deleted file mode 100644 index 9926a8c8d4..0000000000 --- a/playbooks/common-playbooks/haproxy-service-config.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -# Copyright 2023, Cleura 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. - -# Haproxy service configs are stored in service group vars -# (for ex. `glance_haproxy_services` are stored in glance group vars). -# This is because they may refer to other variables in this group that are not -# used only for haproxy(like `glance_backend_ssl`). -# Group haproxy_all does not have access to service group vars by default. -# To solve this, haproxy_all hosts are temporarily added to `service_group`. -# After haproxy is configured, refresh_inventory is triggered to restore the -# original inventory state. - -- name: Adding hosts haproxy_service variables to haproxy - hosts: "{{ service_group }}" - gather_facts: false - run_once: true - tasks: - - name: "Temporarily copy haproxy_service_configs value to haproxy_all from {{ service_group }}" - add_host: - name: "{{ item }}" - haproxy_service_configs: "{{ hostvars[inventory_hostname][service_variable] }}" - with_items: "{{ groups['haproxy_all'] }}" - -- name: Configuring haproxy for the service - hosts: haproxy_all - serial: "{{ haproxy_serial | default('50%') }}" - tasks: - - name: Configure haproxy for the service - import_role: - name: haproxy_server - tasks_from: haproxy_service_config_external.yml diff --git a/playbooks/galera-install.yml b/playbooks/galera-install.yml index 0fd85898c8..61f2a8397c 100644 --- a/playbooks/galera-install.yml +++ b/playbooks/galera-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: galera_all service_variable: "galera_haproxy_services" diff --git a/playbooks/os-adjutant-install.yml b/playbooks/os-adjutant-install.yml index 93fb4b2306..26f7cb2498 100644 --- a/playbooks/os-adjutant-install.yml +++ b/playbooks/os-adjutant-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: adjutant_api service_variable: "adjutant_haproxy_services" diff --git a/playbooks/os-aodh-install.yml b/playbooks/os-aodh-install.yml index 9fdc7dc018..53189f40f5 100644 --- a/playbooks/os-aodh-install.yml +++ b/playbooks/os-aodh-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: aodh_api service_variable: "aodh_haproxy_services" diff --git a/playbooks/os-barbican-install.yml b/playbooks/os-barbican-install.yml index 6cf6cfc745..6ea39cfa0d 100644 --- a/playbooks/os-barbican-install.yml +++ b/playbooks/os-barbican-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: barbican_api service_variable: "barbican_haproxy_services" diff --git a/playbooks/os-blazar-install.yml b/playbooks/os-blazar-install.yml index 05dce8f0b4..dcf6be4663 100644 --- a/playbooks/os-blazar-install.yml +++ b/playbooks/os-blazar-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: blazar_api service_variable: "blazar_haproxy_services" diff --git a/playbooks/os-cinder-install.yml b/playbooks/os-cinder-install.yml index a9270a2947..d9b84e16a0 100644 --- a/playbooks/os-cinder-install.yml +++ b/playbooks/os-cinder-install.yml @@ -51,7 +51,7 @@ cinder_serial: "{{ cinder_backend_serial | default(['1', '100%']) }}" - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: cinder_api service_variable: "cinder_haproxy_services" diff --git a/playbooks/os-cloudkitty-install.yml b/playbooks/os-cloudkitty-install.yml index 9b7a0a5063..ffc93536a6 100644 --- a/playbooks/os-cloudkitty-install.yml +++ b/playbooks/os-cloudkitty-install.yml @@ -25,7 +25,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: cloudkitty_api service_variable: "cloudkitty_haproxy_services" diff --git a/playbooks/os-designate-install.yml b/playbooks/os-designate-install.yml index db709b2538..d8e175ef79 100644 --- a/playbooks/os-designate-install.yml +++ b/playbooks/os-designate-install.yml @@ -27,7 +27,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: designate_api service_variable: "designate_haproxy_services" diff --git a/playbooks/os-glance-install.yml b/playbooks/os-glance-install.yml index 1e0441c167..0e50299d08 100644 --- a/playbooks/os-glance-install.yml +++ b/playbooks/os-glance-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: glance_api service_variable: "glance_haproxy_services" diff --git a/playbooks/os-gnocchi-install.yml b/playbooks/os-gnocchi-install.yml index ae56c2f9d8..0fa02be793 100644 --- a/playbooks/os-gnocchi-install.yml +++ b/playbooks/os-gnocchi-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: gnocchi_api service_variable: "gnocchi_haproxy_services" diff --git a/playbooks/os-heat-install.yml b/playbooks/os-heat-install.yml index bfe9c709f5..b9c2a81f4a 100644 --- a/playbooks/os-heat-install.yml +++ b/playbooks/os-heat-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: heat_api service_variable: "heat_haproxy_services" diff --git a/playbooks/os-horizon-install.yml b/playbooks/os-horizon-install.yml index 69e87cc797..e6f49438a7 100644 --- a/playbooks/os-horizon-install.yml +++ b/playbooks/os-horizon-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: horizon_all service_variable: "horizon_haproxy_services" diff --git a/playbooks/os-ironic-install.yml b/playbooks/os-ironic-install.yml index 8d3f20c6a2..a3d93e6974 100644 --- a/playbooks/os-ironic-install.yml +++ b/playbooks/os-ironic-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: ironic_api service_variable: "ironic_haproxy_services" diff --git a/playbooks/os-keystone-install.yml b/playbooks/os-keystone-install.yml index 777695f5c1..39dcb7a330 100644 --- a/playbooks/os-keystone-install.yml +++ b/playbooks/os-keystone-install.yml @@ -53,7 +53,7 @@ - keystone - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: keystone_all service_variable: "keystone_haproxy_services" diff --git a/playbooks/os-magnum-install.yml b/playbooks/os-magnum-install.yml index 78a32cf005..3c90adf7ab 100644 --- a/playbooks/os-magnum-install.yml +++ b/playbooks/os-magnum-install.yml @@ -27,7 +27,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: magnum_all service_variable: "magnum_haproxy_services" diff --git a/playbooks/os-manila-install.yml b/playbooks/os-manila-install.yml index 381ce9d095..178de1e56e 100644 --- a/playbooks/os-manila-install.yml +++ b/playbooks/os-manila-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: manila_api service_variable: "manila_haproxy_services" diff --git a/playbooks/os-masakari-install.yml b/playbooks/os-masakari-install.yml index 515b729db0..eb29be7e54 100644 --- a/playbooks/os-masakari-install.yml +++ b/playbooks/os-masakari-install.yml @@ -45,7 +45,7 @@ tags: pacemaker-corosync - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: masakari_api service_variable: "masakari_haproxy_services" diff --git a/playbooks/os-mistral-install.yml b/playbooks/os-mistral-install.yml index d698ae5142..49ed0fc5f6 100644 --- a/playbooks/os-mistral-install.yml +++ b/playbooks/os-mistral-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: mistral_api service_variable: "mistral_haproxy_services" diff --git a/playbooks/os-murano-install.yml b/playbooks/os-murano-install.yml index 50bb5653d2..3a45cadc6a 100644 --- a/playbooks/os-murano-install.yml +++ b/playbooks/os-murano-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: murano_api service_variable: "murano_haproxy_services" diff --git a/playbooks/os-neutron-install.yml b/playbooks/os-neutron-install.yml index bb525a1468..c240da1dc3 100644 --- a/playbooks/os-neutron-install.yml +++ b/playbooks/os-neutron-install.yml @@ -46,7 +46,7 @@ group_when: "{{ (neutron_plugin_type | default('ml2.ovn') == 'ml2.ovs.dvr') }}" - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: neutron_server service_variable: "neutron_haproxy_services" diff --git a/playbooks/os-nova-install.yml b/playbooks/os-nova-install.yml index a5ff4ee488..f530476ff2 100644 --- a/playbooks/os-nova-install.yml +++ b/playbooks/os-nova-install.yml @@ -33,7 +33,7 @@ when: osa_gather_facts | default(True) - name: "Config haproxy service" - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: - nova_api_os_compute diff --git a/playbooks/os-octavia-install.yml b/playbooks/os-octavia-install.yml index 541e74d01a..3ecb3712f9 100644 --- a/playbooks/os-octavia-install.yml +++ b/playbooks/os-octavia-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: octavia-api service_variable: "octavia_haproxy_services" diff --git a/playbooks/os-placement-install.yml b/playbooks/os-placement-install.yml index f266612fa2..76da5fa971 100644 --- a/playbooks/os-placement-install.yml +++ b/playbooks/os-placement-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: placement_api service_variable: "placement_haproxy_services" diff --git a/playbooks/os-sahara-install.yml b/playbooks/os-sahara-install.yml index 16d8fbccd7..9272f2265e 100644 --- a/playbooks/os-sahara-install.yml +++ b/playbooks/os-sahara-install.yml @@ -22,7 +22,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: sahara_api service_variable: "sahara_haproxy_services" diff --git a/playbooks/os-senlin-install.yml b/playbooks/os-senlin-install.yml index 2c146db835..0e2165b855 100644 --- a/playbooks/os-senlin-install.yml +++ b/playbooks/os-senlin-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: senlin_api service_variable: "senlin_haproxy_services" diff --git a/playbooks/os-swift-install.yml b/playbooks/os-swift-install.yml index e84f0016a8..ebfe5a9dba 100644 --- a/playbooks/os-swift-install.yml +++ b/playbooks/os-swift-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: swift_all service_variable: "swift_haproxy_services" diff --git a/playbooks/os-tacker-install.yml b/playbooks/os-tacker-install.yml index fc3fa8c6b4..9c5704421f 100644 --- a/playbooks/os-tacker-install.yml +++ b/playbooks/os-tacker-install.yml @@ -24,7 +24,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: tacker_server service_variable: "tacker_haproxy_services" diff --git a/playbooks/os-trove-install.yml b/playbooks/os-trove-install.yml index 83b9517ba7..16d4bea36f 100644 --- a/playbooks/os-trove-install.yml +++ b/playbooks/os-trove-install.yml @@ -27,7 +27,7 @@ - always - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: trove_api service_variable: "trove_haproxy_services" diff --git a/playbooks/os-zun-install.yml b/playbooks/os-zun-install.yml index 062f3cfb35..a206fae750 100644 --- a/playbooks/os-zun-install.yml +++ b/playbooks/os-zun-install.yml @@ -41,7 +41,7 @@ - etcd-server - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: zun_api service_variable: "zun_haproxy_services" diff --git a/playbooks/rabbitmq-install.yml b/playbooks/rabbitmq-install.yml index 14be919df5..0ffcfaa8a2 100644 --- a/playbooks/rabbitmq-install.yml +++ b/playbooks/rabbitmq-install.yml @@ -56,7 +56,7 @@ when: rabbitmq_upgrade | default(false) | bool - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: rabbitmq_all service_variable: "rabbitmq_haproxy_services" diff --git a/playbooks/repo-install.yml b/playbooks/repo-install.yml index 429f462be7..7b6aabd68c 100644 --- a/playbooks/repo-install.yml +++ b/playbooks/repo-install.yml @@ -58,7 +58,7 @@ environment: "{{ deployment_environment_variables | default({}) }}" - name: Configure haproxy services - import_playbook: common-playbooks/haproxy-service-config.yml + import_playbook: openstack.osa.haproxy_service_config vars: service_group: repo_all service_variable: "repo_haproxy_services"