Adopt playbooks for ANSIBLE_GATHER_SUBSET removal

With Ansible 2.18 ANSIBLE_GATHER_SUBSET env var and corresponding
`gather_subset` config parameter was removed in favor of
`module_defaults` parameter.

We adopt our playbooks to respect previous minimal defaults for
facts gathering, along with intorducing new
ansible variable to control it.

Without these changes all facts are being gathered by default.

Change-Id: I3377b5f623fc8ca195d91ef9f9a3af43e010a99c
Signed-off-by: Dmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
This commit is contained in:
Dmitriy Rabotyagov
2025-10-06 18:37:42 +02:00
parent bc1bf029f1
commit d3227cbce9
47 changed files with 154 additions and 0 deletions

View File

@@ -16,6 +16,9 @@
- name: Gather adjutant facts
hosts: adjutant_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather aodh facts
hosts: aodh_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather barbican facts
hosts: barbican_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather blazar facts
hosts: blazar_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather ceilometer facts
hosts: ceilometer_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -169,6 +169,9 @@
- name: Gather ceph-osd facts
hosts: ceph-osd
gather_facts: "{{ osa_gather_facts | default(True) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Define discovered_interpreter_python
ansible.builtin.set_fact:
@@ -265,6 +268,9 @@
- name: Gather ceph-mds facts
hosts: ceph-mds
gather_facts: "{{ osa_gather_facts | default(True) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Define discovered_interpreter_python
ansible.builtin.set_fact:

View File

@@ -16,6 +16,9 @@
- name: Gather ceph-nfs facts
hosts: ceph-nfs
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Define discovered_interpreter_python
ansible.builtin.set_fact:

View File

@@ -20,6 +20,9 @@
- name: Gather ceph-rgw facts
hosts: ceph-rgw
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Define discovered_interpreter_python
ansible.builtin.set_fact:

View File

@@ -15,6 +15,9 @@
- name: Generate any extra user certificates
hosts: "{{ openstack_pki_setup_host | default('localhost') }}"
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always
tasks:

View File

@@ -15,6 +15,9 @@
- name: Create SSHD CA
hosts: "{{ openstack_ssh_keypairs_setup_host | default('localhost') }}"
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always
- sshd-ca

View File

@@ -17,6 +17,9 @@
- name: Gather cloudkitty facts
hosts: cloudkitty_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -36,6 +36,9 @@
- name: Gather lxc hosts facts
hosts: "{{ lxc_host_group | default('lxc_hosts') }}"
gather_facts: true
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always
@@ -68,6 +71,9 @@
- name: Gather lxc containers facts
hosts: all_lxc_containers
gather_facts: true
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always

View File

@@ -16,6 +16,9 @@
- name: Gather lxc hosts facts
hosts: "{{ lxc_host_group | default('lxc_hosts') }}"
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always

View File

@@ -19,6 +19,9 @@
- name: Gather designate facts
hosts: designate_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather galera facts
hosts: galera_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather glance facts
hosts: "glance_all"
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather gnocchi facts
hosts: gnocchi_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather haproxy facts
hosts: haproxy
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather heat facts
hosts: heat_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather horizon facts
hosts: horizon_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather facts
hosts: hosts
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always

View File

@@ -16,6 +16,9 @@
- name: Gather ironic facts
hosts: ironic_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather facts
hosts: hosts
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always

View File

@@ -22,6 +22,9 @@
- name: Implement openrc/clouds.yaml on the designated service host
hosts: "{{ openstack_service_setup_host | default('localhost') }}"
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
become: true
tags:
- openrc
@@ -42,6 +45,9 @@
- name: Gather keystone facts
hosts: keystone_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -19,6 +19,9 @@
- name: Gather magnum facts
hosts: magnum_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -19,6 +19,9 @@
- name: Gather manila facts
hosts: manila_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
serial: "{{ manila_serial | default(['1', '100%']) }}"
tags:
- always

View File

@@ -16,6 +16,9 @@
- name: Gather masakari facts
hosts: masakari_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always

View File

@@ -16,6 +16,9 @@
- name: Gather memcached facts
hosts: memcached
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always

View File

@@ -16,6 +16,9 @@
- name: Gather mistral facts
hosts: mistral_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather octavia facts
hosts: octavia_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -42,6 +42,9 @@
- name: Gather host facts
hosts: "{{ openstack_host_group | default('hosts') }}"
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always

View File

@@ -16,6 +16,9 @@
- name: Gather placement facts
hosts: placement_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather rabbitmq facts
hosts: "{{ rabbitmq_host_group | default('rabbitmq_all') }}"
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always

View File

@@ -16,6 +16,9 @@
- name: Gather rally facts
hosts: utility_all[0]
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always

View File

@@ -16,6 +16,9 @@
- name: Gather repo facts
hosts: repo_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always

View File

@@ -20,6 +20,9 @@
- name: Gather security hardening facts
hosts: "{{ security_host_group | default('hosts') }}"
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather skyline facts
hosts: skyline_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather swift facts
hosts: swift_all:swift_remote_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -18,6 +18,9 @@
- name: Synchronisation of swift ring and ssh keys
hosts: swift_all:swift_remote_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
user: root
pre_tasks:
- name: Setup installation variables

View File

@@ -16,6 +16,9 @@
- name: Gather tacker facts
hosts: tacker_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather tempest facts
hosts: utility_all[0]
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -19,6 +19,9 @@
- name: Gather trove facts
hosts: trove_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -16,6 +16,9 @@
- name: Gather unbound facts
hosts: unbound
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always

View File

@@ -16,6 +16,9 @@
- name: Gather utility facts
hosts: utility_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always

View File

@@ -16,6 +16,9 @@
- name: Gather zookeeper facts
hosts: zookeeper_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tags:
- always

View File

@@ -16,6 +16,9 @@
- name: Gather zun facts
hosts: zun_all
gather_facts: "{{ osa_gather_facts | default(true) }}"
module_defaults:
ansible.builtin.setup:
gather_subset: "{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}"
tasks:
- name: Gather additional facts
ansible.builtin.include_role:

View File

@@ -0,0 +1,7 @@
---
features:
- |
With deprecation and removal of ``ANSIBLE_GATHER_SUBSET``, a new Ansible
variable ``osa_gather_subset`` was implemented to replace it.
``ANSIBLE_GATHER_SUBSET`` is still respected and is used as a fallback in
case ``osa_gather_subset`` is not defined.