From fc558a06f0a683530001e54c5c0d92eb0077ce9a Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Wed, 3 Jul 2024 15:10:21 +0100 Subject: [PATCH] Use unbound_clients role from plugins collection Remove the common-tasks version of this function and instead call a role from the openstack-ansible-plugins collection. Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/923407 Change-Id: I4fb265e966c972ec06760e228575496ba8e5597c --- playbooks/common-tasks/unbound-clients.yml | 65 ---------------------- playbooks/galera-install.yml | 3 +- playbooks/haproxy-install.yml | 3 +- playbooks/memcached-install.yml | 3 +- playbooks/os-adjutant-install.yml | 3 +- playbooks/os-aodh-install.yml | 3 +- playbooks/os-barbican-install.yml | 3 +- playbooks/os-blazar-install.yml | 3 +- playbooks/os-ceilometer-install.yml | 3 +- playbooks/os-cloudkitty-install.yml | 3 +- playbooks/os-designate-install.yml | 3 +- playbooks/os-glance-install.yml | 3 +- playbooks/os-gnocchi-install.yml | 3 +- playbooks/os-heat-install.yml | 3 +- playbooks/os-horizon-install.yml | 3 +- playbooks/os-ironic-install.yml | 3 +- playbooks/os-keystone-install.yml | 3 +- playbooks/os-magnum-install.yml | 3 +- playbooks/os-manila-install.yml | 6 +- playbooks/os-masakari-install.yml | 3 +- playbooks/os-mistral-install.yml | 3 +- playbooks/os-nova-install.yml | 6 +- playbooks/os-octavia-install.yml | 3 +- playbooks/os-placement-install.yml | 3 +- playbooks/os-rally-install.yml | 3 +- playbooks/os-skyline-install.yml | 3 +- playbooks/os-swift-install.yml | 3 +- playbooks/os-trove-install.yml | 3 +- playbooks/os-zun-install.yml | 3 +- playbooks/qdrouterd-install.yml | 3 +- playbooks/rabbitmq-install.yml | 3 +- playbooks/repo-install.yml | 3 +- playbooks/unbound-install.yml | 3 +- playbooks/utility-install.yml | 3 +- 34 files changed, 70 insertions(+), 100 deletions(-) delete mode 100644 playbooks/common-tasks/unbound-clients.yml diff --git a/playbooks/common-tasks/unbound-clients.yml b/playbooks/common-tasks/unbound-clients.yml deleted file mode 100644 index 0d7d4bc4a1..0000000000 --- a/playbooks/common-tasks/unbound-clients.yml +++ /dev/null @@ -1,65 +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. - -# create a sorted resolver list with affinity toward unbound container(s) -# on the same physical_host -- name: Apply resolver sorting - set_fact: - resolver_list: |- - {% set _var = [] %} - {% for host in groups[resolvconf_resolver_group] %} - {% if physical_host is defined and - hostvars[host]['physical_host'] is defined - and physical_host == hostvars[host]['physical_host'] %} - {% set _prio = 100 %} - {% else %} - {% set _prio = 50 %} - {% endif %} - {% set _ = _var.append({ - 'host': hostvars[host]['management_address'], - 'priority': _prio - }) - %} - {% endfor %} - {{ _var | - sort(reverse=true, attribute='priority') | - map(attribute='host') | - list - }} - when: - - physical_host is defined - - physical_host in hostvars['localhost']['unbound_physical_hosts'] - -- name: Set resolver IP list fact - set_fact: - resolvconf_resolver_ips: "{{ resolver_list }}" - resolvconf_options: - - 'timeout:1' - when: - - resolver_list is defined - - resolver_list | length > 0 - -# rotate is only used when no physical_host affinity is defined -- name: Set resolver rotate when physical_host is not an unbound host - set_fact: - resolvconf_options: - - 'timeout:1' - - 'rotate' - when: - - resolver_list is not defined - -- name: Include the resolvconf role - include_role: - name: resolvconf diff --git a/playbooks/galera-install.yml b/playbooks/galera-install.yml index b55c3c8417..7d943866b8 100644 --- a/playbooks/galera-install.yml +++ b/playbooks/galera-install.yml @@ -47,7 +47,8 @@ extra_container_config_no_restart: - "lxc.start.order=10" - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool - name: Disabling haproxy backends diff --git a/playbooks/haproxy-install.yml b/playbooks/haproxy-install.yml index 418259364b..82cebbcba3 100644 --- a/playbooks/haproxy-install.yml +++ b/playbooks/haproxy-install.yml @@ -34,7 +34,8 @@ name: "openstack.osa.{{ container_tech | default('lxc') }}_container_setup" when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool - name: Remove legacy haproxy configuration files diff --git a/playbooks/memcached-install.yml b/playbooks/memcached-install.yml index f0a4309009..437622e340 100644 --- a/playbooks/memcached-install.yml +++ b/playbooks/memcached-install.yml @@ -30,7 +30,8 @@ name: "openstack.osa.{{ container_tech | default('lxc') }}_container_setup" when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool roles: diff --git a/playbooks/os-adjutant-install.yml b/playbooks/os-adjutant-install.yml index df42418c31..da4f7834e0 100644 --- a/playbooks/os-adjutant-install.yml +++ b/playbooks/os-adjutant-install.yml @@ -60,7 +60,8 @@ - always - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool diff --git a/playbooks/os-aodh-install.yml b/playbooks/os-aodh-install.yml index d0b651313c..61e45b4e4b 100644 --- a/playbooks/os-aodh-install.yml +++ b/playbooks/os-aodh-install.yml @@ -66,7 +66,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool diff --git a/playbooks/os-barbican-install.yml b/playbooks/os-barbican-install.yml index 92ac254795..996aa7b793 100644 --- a/playbooks/os-barbican-install.yml +++ b/playbooks/os-barbican-install.yml @@ -65,7 +65,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool roles: diff --git a/playbooks/os-blazar-install.yml b/playbooks/os-blazar-install.yml index c56f6efd9b..170eb80561 100644 --- a/playbooks/os-blazar-install.yml +++ b/playbooks/os-blazar-install.yml @@ -65,7 +65,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool diff --git a/playbooks/os-ceilometer-install.yml b/playbooks/os-ceilometer-install.yml index a73df35075..f87945e783 100644 --- a/playbooks/os-ceilometer-install.yml +++ b/playbooks/os-ceilometer-install.yml @@ -41,7 +41,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool roles: diff --git a/playbooks/os-cloudkitty-install.yml b/playbooks/os-cloudkitty-install.yml index ced2cd6d5e..7c63705417 100644 --- a/playbooks/os-cloudkitty-install.yml +++ b/playbooks/os-cloudkitty-install.yml @@ -61,7 +61,8 @@ - always - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool diff --git a/playbooks/os-designate-install.yml b/playbooks/os-designate-install.yml index 4fdd644de0..7b63d5c13f 100644 --- a/playbooks/os-designate-install.yml +++ b/playbooks/os-designate-install.yml @@ -68,7 +68,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool roles: diff --git a/playbooks/os-glance-install.yml b/playbooks/os-glance-install.yml index 5eaa0b5b89..73edcc47e0 100644 --- a/playbooks/os-glance-install.yml +++ b/playbooks/os-glance-install.yml @@ -77,7 +77,8 @@ - (glance_default_store != "file") or (glance_remote_client is defined) - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool diff --git a/playbooks/os-gnocchi-install.yml b/playbooks/os-gnocchi-install.yml index 85a11fa83a..4b35cbdc59 100644 --- a/playbooks/os-gnocchi-install.yml +++ b/playbooks/os-gnocchi-install.yml @@ -69,7 +69,8 @@ - (gnocchi_storage_driver | default('file')) != "file" - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool roles: diff --git a/playbooks/os-heat-install.yml b/playbooks/os-heat-install.yml index 717c9f2a33..7519229eb6 100644 --- a/playbooks/os-heat-install.yml +++ b/playbooks/os-heat-install.yml @@ -65,7 +65,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool roles: diff --git a/playbooks/os-horizon-install.yml b/playbooks/os-horizon-install.yml index 58e74dde90..8390c66fef 100644 --- a/playbooks/os-horizon-install.yml +++ b/playbooks/os-horizon-install.yml @@ -64,7 +64,8 @@ name: "openstack.osa.{{ container_tech | default('lxc') }}_container_setup" when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool roles: diff --git a/playbooks/os-ironic-install.yml b/playbooks/os-ironic-install.yml index e24a033ada..21d90c05a0 100644 --- a/playbooks/os-ironic-install.yml +++ b/playbooks/os-ironic-install.yml @@ -65,7 +65,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool roles: diff --git a/playbooks/os-keystone-install.yml b/playbooks/os-keystone-install.yml index ec80ed1733..fe07491585 100644 --- a/playbooks/os-keystone-install.yml +++ b/playbooks/os-keystone-install.yml @@ -100,7 +100,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool diff --git a/playbooks/os-magnum-install.yml b/playbooks/os-magnum-install.yml index cdc5a16da7..a4b65600c1 100644 --- a/playbooks/os-magnum-install.yml +++ b/playbooks/os-magnum-install.yml @@ -68,7 +68,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool diff --git a/playbooks/os-manila-install.yml b/playbooks/os-manila-install.yml index e3cc1b1526..cfccf140bf 100644 --- a/playbooks/os-manila-install.yml +++ b/playbooks/os-manila-install.yml @@ -69,7 +69,8 @@ - always - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool @@ -105,7 +106,8 @@ public: true - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool diff --git a/playbooks/os-masakari-install.yml b/playbooks/os-masakari-install.yml index 5b0852ac2c..8348407b2b 100644 --- a/playbooks/os-masakari-install.yml +++ b/playbooks/os-masakari-install.yml @@ -95,7 +95,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool diff --git a/playbooks/os-mistral-install.yml b/playbooks/os-mistral-install.yml index 899afaaf67..95d5e101b4 100644 --- a/playbooks/os-mistral-install.yml +++ b/playbooks/os-mistral-install.yml @@ -66,7 +66,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool diff --git a/playbooks/os-nova-install.yml b/playbooks/os-nova-install.yml index 9224fd8bc1..8216b3ae21 100644 --- a/playbooks/os-nova-install.yml +++ b/playbooks/os-nova-install.yml @@ -102,7 +102,8 @@ - "lxc.start.order=39" - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool @@ -174,7 +175,8 @@ - "lxc.start.order=39" - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool diff --git a/playbooks/os-octavia-install.yml b/playbooks/os-octavia-install.yml index 17538ce32c..999e841700 100644 --- a/playbooks/os-octavia-install.yml +++ b/playbooks/os-octavia-install.yml @@ -66,7 +66,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool roles: diff --git a/playbooks/os-placement-install.yml b/playbooks/os-placement-install.yml index 89e727487e..b8a6313d39 100644 --- a/playbooks/os-placement-install.yml +++ b/playbooks/os-placement-install.yml @@ -66,7 +66,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool roles: diff --git a/playbooks/os-rally-install.yml b/playbooks/os-rally-install.yml index 8f98be5721..7502f17b7a 100644 --- a/playbooks/os-rally-install.yml +++ b/playbooks/os-rally-install.yml @@ -36,7 +36,8 @@ when: - (not (rally_install | default(false)) | bool) - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool roles: diff --git a/playbooks/os-skyline-install.yml b/playbooks/os-skyline-install.yml index cec036aba6..3f09f88204 100644 --- a/playbooks/os-skyline-install.yml +++ b/playbooks/os-skyline-install.yml @@ -51,7 +51,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool diff --git a/playbooks/os-swift-install.yml b/playbooks/os-swift-install.yml index cd4220b517..3656b0125c 100644 --- a/playbooks/os-swift-install.yml +++ b/playbooks/os-swift-install.yml @@ -52,7 +52,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool diff --git a/playbooks/os-trove-install.yml b/playbooks/os-trove-install.yml index 17cffa0dff..4af81b8c0d 100644 --- a/playbooks/os-trove-install.yml +++ b/playbooks/os-trove-install.yml @@ -69,7 +69,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool roles: diff --git a/playbooks/os-zun-install.yml b/playbooks/os-zun-install.yml index 94522b4133..536efd4228 100644 --- a/playbooks/os-zun-install.yml +++ b/playbooks/os-zun-install.yml @@ -82,7 +82,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool diff --git a/playbooks/qdrouterd-install.yml b/playbooks/qdrouterd-install.yml index bfb4b7469b..aab0770813 100644 --- a/playbooks/qdrouterd-install.yml +++ b/playbooks/qdrouterd-install.yml @@ -37,7 +37,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool roles: diff --git a/playbooks/rabbitmq-install.yml b/playbooks/rabbitmq-install.yml index 0ed735d12e..0ffc7e6a5a 100644 --- a/playbooks/rabbitmq-install.yml +++ b/playbooks/rabbitmq-install.yml @@ -34,7 +34,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool roles: diff --git a/playbooks/repo-install.yml b/playbooks/repo-install.yml index 3f00b0ac73..7722975a27 100644 --- a/playbooks/repo-install.yml +++ b/playbooks/repo-install.yml @@ -38,7 +38,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool environment: "{{ deployment_environment_variables | default({}) }}" diff --git a/playbooks/unbound-install.yml b/playbooks/unbound-install.yml index d44a9d0aae..c137c45522 100644 --- a/playbooks/unbound-install.yml +++ b/playbooks/unbound-install.yml @@ -44,7 +44,8 @@ user: root tasks: - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool environment: "{{ deployment_environment_variables | default({}) }}" diff --git a/playbooks/utility-install.yml b/playbooks/utility-install.yml index 5e62732cec..92df274c9c 100644 --- a/playbooks/utility-install.yml +++ b/playbooks/utility-install.yml @@ -58,7 +58,8 @@ when: not is_metal - name: Including unbound-clients tasks - include_tasks: common-tasks/unbound-clients.yml + include_role: + name: openstack.osa.unbound_clients when: - hostvars['localhost']['resolvconf_enabled'] | bool