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
This commit is contained in:
Jonathan Rosser 2023-11-08 16:10:53 +00:00
parent d980045dbd
commit 2302883430
32 changed files with 31 additions and 74 deletions

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"