diff --git a/playbooks/common-playbooks/cinder.yml b/playbooks/common-playbooks/cinder.yml index f2de6b9d1c..99795af343 100644 --- a/playbooks/common-playbooks/cinder.yml +++ b/playbooks/common-playbooks/cinder.yml @@ -31,7 +31,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: ../common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: cinder_api-back haproxy_state: disabled @@ -114,7 +115,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: ../common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: cinder_api-back haproxy_state: enabled diff --git a/playbooks/common-playbooks/neutron.yml b/playbooks/common-playbooks/neutron.yml index ce67d90fc1..6ada7c1033 100644 --- a/playbooks/common-playbooks/neutron.yml +++ b/playbooks/common-playbooks/neutron.yml @@ -31,7 +31,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: ../common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: neutron_server-back haproxy_state: disabled @@ -87,7 +88,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: ../common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: neutron_server-back haproxy_state: enabled diff --git a/playbooks/common-tasks/haproxy-endpoint-manage.yml b/playbooks/common-tasks/haproxy-endpoint-manage.yml deleted file mode 100644 index c630ae951e..0000000000 --- a/playbooks/common-tasks/haproxy-endpoint-manage.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -# Copyright 2017, Logan Vig -# -# 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: Set haproxy service state - community.general.haproxy: - socket: /var/run/haproxy.stat - backend: "{{ haproxy_backend | default(omit) }}" - drain: "{{ haproxy_drain | default(False) }}" - host: "{{ inventory_hostname }}" - state: "{{ haproxy_state | default('enabled') }}" - shutdown_sessions: "{{ haproxy_shutdown_sessions | default(False) | bool }}" - wait: "{{ haproxy_wait | default(False) | bool }}" - wait_interval: "{{ haproxy_wait_interval | default(5) }}" - wait_retries: "{{ haproxy_wait_retries | default(24) }}" - weight: "{{ haproxy_weight | default(omit) }}" - delegate_to: "{{ item }}" - with_items: "{{ groups['haproxy'] }}" - tags: - - common-haproxy diff --git a/playbooks/galera-install.yml b/playbooks/galera-install.yml index b55c3c8417..649628d2c5 100644 --- a/playbooks/galera-install.yml +++ b/playbooks/galera-install.yml @@ -51,7 +51,8 @@ when: - hostvars['localhost']['resolvconf_enabled'] | bool - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: galera-back haproxy_state: drain @@ -67,7 +68,8 @@ - crontab post_tasks: - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: galera-back haproxy_state: enabled diff --git a/playbooks/os-adjutant-install.yml b/playbooks/os-adjutant-install.yml index df42418c31..6ef9548cd8 100644 --- a/playbooks/os-adjutant-install.yml +++ b/playbooks/os-adjutant-install.yml @@ -49,7 +49,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: adjutant_api-back haproxy_state: disabled @@ -72,7 +73,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: adjutant_api-back haproxy_state: enabled diff --git a/playbooks/os-aodh-install.yml b/playbooks/os-aodh-install.yml index d0b651313c..1c2f04609f 100644 --- a/playbooks/os-aodh-install.yml +++ b/playbooks/os-aodh-install.yml @@ -50,7 +50,8 @@ public: true - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: aodh_api-back haproxy_state: disabled @@ -78,7 +79,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: aodh_api-back haproxy_state: enabled diff --git a/playbooks/os-barbican-install.yml b/playbooks/os-barbican-install.yml index 92ac254795..7751cb2649 100644 --- a/playbooks/os-barbican-install.yml +++ b/playbooks/os-barbican-install.yml @@ -49,7 +49,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: barbican-back haproxy_state: disabled @@ -76,7 +77,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: barbican-back haproxy_state: enabled diff --git a/playbooks/os-blazar-install.yml b/playbooks/os-blazar-install.yml index c56f6efd9b..b4170974e8 100644 --- a/playbooks/os-blazar-install.yml +++ b/playbooks/os-blazar-install.yml @@ -49,7 +49,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: blazar_api-back haproxy_state: disabled @@ -80,7 +81,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: blazar_api-back haproxy_state: enabled diff --git a/playbooks/os-cloudkitty-install.yml b/playbooks/os-cloudkitty-install.yml index ced2cd6d5e..7bcd6e7e8e 100644 --- a/playbooks/os-cloudkitty-install.yml +++ b/playbooks/os-cloudkitty-install.yml @@ -50,7 +50,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: cloudkitty_api-back haproxy_state: disabled @@ -73,7 +74,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: cloudkitty_api-back haproxy_state: enabled diff --git a/playbooks/os-designate-install.yml b/playbooks/os-designate-install.yml index 4fdd644de0..3360840a3f 100644 --- a/playbooks/os-designate-install.yml +++ b/playbooks/os-designate-install.yml @@ -52,7 +52,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: designate_api-back haproxy_state: disabled @@ -79,7 +80,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: designate_api-back haproxy_state: enabled diff --git a/playbooks/os-glance-install.yml b/playbooks/os-glance-install.yml index 5eaa0b5b89..b639e29fe6 100644 --- a/playbooks/os-glance-install.yml +++ b/playbooks/os-glance-install.yml @@ -49,7 +49,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: glance_api-back haproxy_state: disabled @@ -92,7 +93,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: glance_api-back haproxy_state: enabled diff --git a/playbooks/os-gnocchi-install.yml b/playbooks/os-gnocchi-install.yml index 85a11fa83a..28e0db2687 100644 --- a/playbooks/os-gnocchi-install.yml +++ b/playbooks/os-gnocchi-install.yml @@ -49,7 +49,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: gnocchi-back haproxy_state: disabled @@ -80,7 +81,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: gnocchi-back haproxy_state: enabled diff --git a/playbooks/os-heat-install.yml b/playbooks/os-heat-install.yml index 717c9f2a33..1eaa8958ed 100644 --- a/playbooks/os-heat-install.yml +++ b/playbooks/os-heat-install.yml @@ -49,7 +49,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: heat_api-back haproxy_state: disabled @@ -79,7 +80,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: heat_api-back haproxy_state: enabled diff --git a/playbooks/os-horizon-install.yml b/playbooks/os-horizon-install.yml index 58e74dde90..cb660542e4 100644 --- a/playbooks/os-horizon-install.yml +++ b/playbooks/os-horizon-install.yml @@ -49,7 +49,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: horizon-back haproxy_state: disabled @@ -78,7 +79,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: horizon-back haproxy_state: enabled diff --git a/playbooks/os-ironic-install.yml b/playbooks/os-ironic-install.yml index e24a033ada..8ad445a6f9 100644 --- a/playbooks/os-ironic-install.yml +++ b/playbooks/os-ironic-install.yml @@ -49,7 +49,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: ironic_api-back haproxy_state: disabled @@ -79,7 +80,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: ironic_api-back haproxy_state: enabled diff --git a/playbooks/os-keystone-install.yml b/playbooks/os-keystone-install.yml index ec80ed1733..eed0d2f752 100644 --- a/playbooks/os-keystone-install.yml +++ b/playbooks/os-keystone-install.yml @@ -81,7 +81,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: "keystone_service-back" haproxy_state: disabled @@ -115,7 +116,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: "keystone_service-back" haproxy_state: enabled diff --git a/playbooks/os-magnum-install.yml b/playbooks/os-magnum-install.yml index cdc5a16da7..c36d8efff3 100644 --- a/playbooks/os-magnum-install.yml +++ b/playbooks/os-magnum-install.yml @@ -52,7 +52,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: magnum-back haproxy_state: disabled @@ -80,7 +81,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: magnum-back haproxy_state: enabled diff --git a/playbooks/os-manila-install.yml b/playbooks/os-manila-install.yml index e3cc1b1526..3fc61c628c 100644 --- a/playbooks/os-manila-install.yml +++ b/playbooks/os-manila-install.yml @@ -58,7 +58,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: manila-back haproxy_state: disabled @@ -81,7 +82,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: manila-back haproxy_state: enabled diff --git a/playbooks/os-masakari-install.yml b/playbooks/os-masakari-install.yml index 5b0852ac2c..569eed6086 100644 --- a/playbooks/os-masakari-install.yml +++ b/playbooks/os-masakari-install.yml @@ -79,7 +79,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: masakari_api-back haproxy_state: disabled @@ -107,7 +108,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: masakari_api-back haproxy_state: enabled diff --git a/playbooks/os-mistral-install.yml b/playbooks/os-mistral-install.yml index 899afaaf67..e961bdee9a 100644 --- a/playbooks/os-mistral-install.yml +++ b/playbooks/os-mistral-install.yml @@ -50,7 +50,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: mistral-back haproxy_state: disabled @@ -81,7 +82,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: mistral-back haproxy_state: enabled diff --git a/playbooks/os-nova-install.yml b/playbooks/os-nova-install.yml index 9224fd8bc1..f5bdc0c1c9 100644 --- a/playbooks/os-nova-install.yml +++ b/playbooks/os-nova-install.yml @@ -77,7 +77,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: "{{ backend_name }}-back" haproxy_state: disabled @@ -120,7 +121,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: "{{ backend_name }}-back" haproxy_state: enabled diff --git a/playbooks/os-octavia-install.yml b/playbooks/os-octavia-install.yml index 17538ce32c..e71419dda4 100644 --- a/playbooks/os-octavia-install.yml +++ b/playbooks/os-octavia-install.yml @@ -50,7 +50,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: octavia-back haproxy_state: disabled @@ -80,7 +81,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: octavia-back haproxy_state: enabled diff --git a/playbooks/os-placement-install.yml b/playbooks/os-placement-install.yml index 89e727487e..f999e120e9 100644 --- a/playbooks/os-placement-install.yml +++ b/playbooks/os-placement-install.yml @@ -50,7 +50,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: placement-back haproxy_state: disabled @@ -80,7 +81,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: placement-back haproxy_state: enabled diff --git a/playbooks/os-tacker-install.yml b/playbooks/os-tacker-install.yml index 8f3bc00569..44f559eb9c 100644 --- a/playbooks/os-tacker-install.yml +++ b/playbooks/os-tacker-install.yml @@ -50,7 +50,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: tacker-back haproxy_state: disabled @@ -71,7 +72,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: tacker-back haproxy_state: enabled diff --git a/playbooks/os-trove-install.yml b/playbooks/os-trove-install.yml index 17cffa0dff..422d34b1d9 100644 --- a/playbooks/os-trove-install.yml +++ b/playbooks/os-trove-install.yml @@ -53,7 +53,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: trove-back haproxy_state: disabled @@ -80,7 +81,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: trove-back haproxy_state: enabled diff --git a/playbooks/os-zun-install.yml b/playbooks/os-zun-install.yml index 94522b4133..6de9b045bd 100644 --- a/playbooks/os-zun-install.yml +++ b/playbooks/os-zun-install.yml @@ -66,7 +66,8 @@ # restart do not cause an unexpected outage, we drain # the load balancer back end for this container. - name: Disabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: zun_api-back haproxy_state: disabled @@ -94,7 +95,8 @@ # the load balancer back end for this container # to available again. - name: Enabling haproxy backends - include_tasks: common-tasks/haproxy-endpoint-manage.yml + include_role: + name: openstack.osa.haproxy_endpoint_manage vars: haproxy_backend: zun_api-back haproxy_state: enabled