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
This commit is contained in:
Jonathan Rosser 2024-07-03 15:10:21 +01:00
parent 9f5b23a2e4
commit fc558a06f0
34 changed files with 70 additions and 100 deletions

View File

@ -1,65 +0,0 @@
---
# Copyright 2017, Logan Vig <logan2211@gmail.com>
#
# 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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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({}) }}"

View File

@ -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({}) }}"

View File

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