From 2492d82da6fe3070528f6155bb918e45d0501809 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Fri, 25 Mar 2022 19:56:44 +0100 Subject: [PATCH] Fix extra facts gathering with tags When switching to gathering min facts, we introduced common task that was responsible for gathering specific subset. However we used include_task and not applied always tag to include. That resulted in effect that facts were not gathered when playbook run with tags and leads to failure. To workaround that we move include to prior facts gathering stanza. As alternative option for ceph we applied always tag to include. Change-Id: Ie996262043edb8fb9c7221a5cd98e98a0111ac28 --- playbooks/ceph-install.yml | 20 +++++++++++++++++++ playbooks/galera-install.yml | 8 ++++---- playbooks/haproxy-install.yml | 8 ++++---- playbooks/os-adjutant-install.yml | 9 ++++----- playbooks/os-aodh-install.yml | 9 ++++----- playbooks/os-barbican-install.yml | 9 ++++----- playbooks/os-blazar-install.yml | 9 ++++----- playbooks/os-ceilometer-install.yml | 9 ++++----- playbooks/os-cloudkitty-install.yml | 9 ++++----- playbooks/os-designate-install.yml | 9 ++++----- playbooks/os-glance-install.yml | 9 ++++----- playbooks/os-gnocchi-install.yml | 9 ++++----- playbooks/os-heat-install.yml | 9 ++++----- playbooks/os-horizon-install.yml | 9 ++++----- playbooks/os-ironic-install.yml | 9 ++++----- playbooks/os-keystone-install.yml | 9 ++++----- playbooks/os-magnum-install.yml | 9 ++++----- playbooks/os-manila-install.yml | 4 ++++ playbooks/os-masakari-install.yml | 19 ++++++------------ playbooks/os-mistral-install.yml | 9 ++++----- playbooks/os-murano-install.yml | 9 ++++----- playbooks/os-octavia-install.yml | 9 ++++----- playbooks/os-placement-install.yml | 9 ++++----- playbooks/os-sahara-install.yml | 9 ++++----- playbooks/os-senlin-install.yml | 9 ++++----- playbooks/os-swift-install.yml | 9 ++++----- playbooks/os-tacker-install.yml | 9 ++++----- playbooks/os-tempest-install.yml | 9 ++++----- playbooks/os-trove-install.yml | 9 ++++----- playbooks/os-zun-install.yml | 9 ++++----- playbooks/security-hardening.yml | 14 ++++++------- ...facts_gathering_tags-69babd74af6e7470.yaml | 4 ++++ 32 files changed, 149 insertions(+), 153 deletions(-) create mode 100644 releasenotes/notes/facts_gathering_tags-69babd74af6e7470.yaml diff --git a/playbooks/ceph-install.yml b/playbooks/ceph-install.yml index 23f013263d..cb4e683ffc 100644 --- a/playbooks/ceph-install.yml +++ b/playbooks/ceph-install.yml @@ -33,6 +33,10 @@ deployment_extra_facts_filter: "ansible_all_ipv[4|6]_addresses" deployment_extra_facts_subset: "!all,network" when: monitor_address_block is defined + args: + apply: + tags: + - always tags: - always @@ -42,6 +46,10 @@ deployment_extra_facts_filter: "{{ 'ansible_' ~ monitor_interface | replace('-','_') }}" deployment_extra_facts_subset: "!all,network" when: monitor_interface is defined + args: + apply: + tags: + - always tags: - always @@ -50,6 +58,10 @@ vars: deployment_extra_facts_filter: "ansible_memtotal*" deployment_extra_facts_subset: "!all,hardware" + args: + apply: + tags: + - always tags: - always @@ -133,6 +145,10 @@ vars: deployment_extra_facts_filter: "ansible_memtotal*" deployment_extra_facts_subset: "!all,hardware" + args: + apply: + tags: + - always tags: - always @@ -191,6 +207,10 @@ vars: deployment_extra_facts_filter: "ansible_memtotal*" deployment_extra_facts_subset: "!all,hardware" + args: + apply: + tags: + - always tags: - always roles: diff --git a/playbooks/galera-install.yml b/playbooks/galera-install.yml index bdc00ae8d8..0f10eeb94c 100644 --- a/playbooks/galera-install.yml +++ b/playbooks/galera-install.yml @@ -16,6 +16,10 @@ - name: Gather galera facts hosts: galera_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -25,10 +29,6 @@ serial: "{{ galera_serial | default(1) }}" user: root pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal vars: diff --git a/playbooks/haproxy-install.yml b/playbooks/haproxy-install.yml index b921df75af..9029376af9 100644 --- a/playbooks/haproxy-install.yml +++ b/playbooks/haproxy-install.yml @@ -16,6 +16,10 @@ - name: Gather haproxy facts hosts: haproxy gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -25,10 +29,6 @@ serial: "{{ haproxy_serial | default('50%') }}" user: root pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal - include_tasks: common-tasks/unbound-clients.yml diff --git a/playbooks/os-adjutant-install.yml b/playbooks/os-adjutant-install.yml index 4aca721fb0..3b8d6733c1 100644 --- a/playbooks/os-adjutant-install.yml +++ b/playbooks/os-adjutant-install.yml @@ -16,6 +16,10 @@ - name: Gather adjutant facts hosts: adjutant_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -31,11 +35,6 @@ tags: - adjutant pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - # In order to ensure that any container, software or # config file changes which causes a container/service # restart do not cause an unexpected outage, we drain diff --git a/playbooks/os-aodh-install.yml b/playbooks/os-aodh-install.yml index a1627e4850..e2ea9f45be 100644 --- a/playbooks/os-aodh-install.yml +++ b/playbooks/os-aodh-install.yml @@ -16,6 +16,10 @@ - name: Gather aodh facts hosts: aodh_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -31,11 +35,6 @@ tags: - aodh pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal diff --git a/playbooks/os-barbican-install.yml b/playbooks/os-barbican-install.yml index 33b7ad3b08..5eec497e4f 100644 --- a/playbooks/os-barbican-install.yml +++ b/playbooks/os-barbican-install.yml @@ -16,6 +16,10 @@ - name: Gather barbican facts hosts: barbican_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -31,11 +35,6 @@ tags: - barbican pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal diff --git a/playbooks/os-blazar-install.yml b/playbooks/os-blazar-install.yml index c3bbd9faa7..eb8a6d4ce7 100644 --- a/playbooks/os-blazar-install.yml +++ b/playbooks/os-blazar-install.yml @@ -16,6 +16,10 @@ - name: Gather blazar facts hosts: blazar_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -31,11 +35,6 @@ tags: - blazar pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal diff --git a/playbooks/os-ceilometer-install.yml b/playbooks/os-ceilometer-install.yml index db74f80f49..e737cccc67 100644 --- a/playbooks/os-ceilometer-install.yml +++ b/playbooks/os-ceilometer-install.yml @@ -16,6 +16,10 @@ - name: Gather ceilometer facts hosts: ceilometer_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -28,11 +32,6 @@ - "defaults/repo_packages/openstack_services.yml" - "defaults/{{ install_method }}_install.yml" pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal diff --git a/playbooks/os-cloudkitty-install.yml b/playbooks/os-cloudkitty-install.yml index 21e6951901..7ef88da6ba 100644 --- a/playbooks/os-cloudkitty-install.yml +++ b/playbooks/os-cloudkitty-install.yml @@ -17,6 +17,10 @@ - name: Gather cloudkitty facts hosts: cloudkitty_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -32,11 +36,6 @@ tags: - cloudkitty pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - # In order to ensure that any container, software or # config file changes which causes a container/service # restart do not cause an unexpected outage, we drain diff --git a/playbooks/os-designate-install.yml b/playbooks/os-designate-install.yml index 9ca59b4de8..91999dd6b6 100644 --- a/playbooks/os-designate-install.yml +++ b/playbooks/os-designate-install.yml @@ -19,6 +19,10 @@ - name: Gather designate facts hosts: designate_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -34,11 +38,6 @@ tags: - designate pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal diff --git a/playbooks/os-glance-install.yml b/playbooks/os-glance-install.yml index 552a34324d..37c70b42e0 100644 --- a/playbooks/os-glance-install.yml +++ b/playbooks/os-glance-install.yml @@ -16,6 +16,10 @@ - name: Gather glance facts hosts: "glance_all" gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -31,11 +35,6 @@ tags: - glance pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - # In order to ensure that any container, software or # config file changes which causes a container/service # restart do not cause an unexpected outage, we drain diff --git a/playbooks/os-gnocchi-install.yml b/playbooks/os-gnocchi-install.yml index 4d48d19df5..7c2ca2c0a7 100644 --- a/playbooks/os-gnocchi-install.yml +++ b/playbooks/os-gnocchi-install.yml @@ -16,6 +16,10 @@ - name: Gather gnocchi facts hosts: gnocchi_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -32,11 +36,6 @@ tags: - gnocchi pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" vars: list_of_bind_mounts: "{{ gnocchi_container_bind_mounts }}" diff --git a/playbooks/os-heat-install.yml b/playbooks/os-heat-install.yml index b65d9ccb5c..06f287eba4 100644 --- a/playbooks/os-heat-install.yml +++ b/playbooks/os-heat-install.yml @@ -16,6 +16,10 @@ - name: Gather heat facts hosts: heat_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -31,11 +35,6 @@ - defaults/repo_packages/openstack_services.yml - "defaults/{{ install_method }}_install.yml" pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal diff --git a/playbooks/os-horizon-install.yml b/playbooks/os-horizon-install.yml index b83f872dfd..e0e6d1326d 100644 --- a/playbooks/os-horizon-install.yml +++ b/playbooks/os-horizon-install.yml @@ -16,6 +16,10 @@ - name: Gather horizon facts hosts: horizon_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -31,11 +35,6 @@ tags: - horizon pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal - include_tasks: common-tasks/unbound-clients.yml diff --git a/playbooks/os-ironic-install.yml b/playbooks/os-ironic-install.yml index 8ce5218aec..903d4a3cba 100644 --- a/playbooks/os-ironic-install.yml +++ b/playbooks/os-ironic-install.yml @@ -16,6 +16,10 @@ - name: Gather ironic facts hosts: ironic_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -31,11 +35,6 @@ tags: - ironic pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal diff --git a/playbooks/os-keystone-install.yml b/playbooks/os-keystone-install.yml index 1bb76d4e89..569339a202 100644 --- a/playbooks/os-keystone-install.yml +++ b/playbooks/os-keystone-install.yml @@ -31,6 +31,10 @@ - name: Gather keystone facts hosts: keystone_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -46,11 +50,6 @@ tags: - keystone pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - # In order to ensure that any container, software or # config file changes which causes a container/service # restart do not cause an unexpected outage, we drain diff --git a/playbooks/os-magnum-install.yml b/playbooks/os-magnum-install.yml index 249f0970cc..b21fbed530 100644 --- a/playbooks/os-magnum-install.yml +++ b/playbooks/os-magnum-install.yml @@ -19,6 +19,10 @@ - name: Gather magnum facts hosts: magnum_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -34,11 +38,6 @@ tags: - magnum pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal diff --git a/playbooks/os-manila-install.yml b/playbooks/os-manila-install.yml index d76937f405..78604fb2c2 100644 --- a/playbooks/os-manila-install.yml +++ b/playbooks/os-manila-install.yml @@ -36,6 +36,10 @@ pre_tasks: - name: Gather additional facts include_tasks: "common-tasks/gather-hardware-facts.yml" + args: + apply: + tags: + - always tags: - always diff --git a/playbooks/os-masakari-install.yml b/playbooks/os-masakari-install.yml index c094ae5b94..af07de5fd6 100644 --- a/playbooks/os-masakari-install.yml +++ b/playbooks/os-masakari-install.yml @@ -16,6 +16,12 @@ - name: Gather masakari facts hosts: masakari_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + vars: + deployment_extra_facts_filter: "{{ 'ansible_' ~ pacemaker_corosync_ring_interface | replace('-','_') }}" + deployment_extra_facts_subset: "!all,network" tags: - always @@ -28,14 +34,6 @@ pacemaker_corosync_group: masakari_monitor pacemaker_corosync_ring_interface: "{{ masakari_monitor_corosync_multicast_interface }}" haveged_enabled: false - pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - vars: - deployment_extra_facts_filter: "{{ 'ansible_' ~ pacemaker_corosync_ring_interface | replace('-','_') }}" - deployment_extra_facts_subset: "!all,network" - tags: - - always roles: - role: "pacemaker_corosync" tags: pacemaker-corosync @@ -49,11 +47,6 @@ - "defaults/repo_packages/openstack_services.yml" - "defaults/{{ install_method }}_install.yml" pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - # In order to ensure that any container, software or # config file changes which causes a container/service # restart do not cause an unexpected outage, we drain diff --git a/playbooks/os-mistral-install.yml b/playbooks/os-mistral-install.yml index 0e5d71d6ab..7e1d5ff243 100644 --- a/playbooks/os-mistral-install.yml +++ b/playbooks/os-mistral-install.yml @@ -16,6 +16,10 @@ - name: Gather mistral facts hosts: mistral_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -31,11 +35,6 @@ tags: - mistral pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal diff --git a/playbooks/os-murano-install.yml b/playbooks/os-murano-install.yml index 042acc7fcd..238d9335f5 100644 --- a/playbooks/os-murano-install.yml +++ b/playbooks/os-murano-install.yml @@ -16,6 +16,10 @@ - name: Gather murano facts hosts: murano_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -31,11 +35,6 @@ tags: - murano pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal diff --git a/playbooks/os-octavia-install.yml b/playbooks/os-octavia-install.yml index 99a772956c..e1b01fb62b 100644 --- a/playbooks/os-octavia-install.yml +++ b/playbooks/os-octavia-install.yml @@ -16,6 +16,10 @@ - name: Gather octavia facts hosts: octavia_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -31,11 +35,6 @@ tags: - octavia pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal diff --git a/playbooks/os-placement-install.yml b/playbooks/os-placement-install.yml index 80617e5b17..c2d5b47e67 100644 --- a/playbooks/os-placement-install.yml +++ b/playbooks/os-placement-install.yml @@ -16,6 +16,10 @@ - name: Gather placement facts hosts: placement_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -31,11 +35,6 @@ tags: - placement pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal diff --git a/playbooks/os-sahara-install.yml b/playbooks/os-sahara-install.yml index 66da1ea23b..f4c47aecfc 100644 --- a/playbooks/os-sahara-install.yml +++ b/playbooks/os-sahara-install.yml @@ -14,6 +14,10 @@ - name: Gather sahara facts hosts: sahara_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -29,11 +33,6 @@ tags: - sahara pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal diff --git a/playbooks/os-senlin-install.yml b/playbooks/os-senlin-install.yml index cb337f11a5..336eab11b4 100644 --- a/playbooks/os-senlin-install.yml +++ b/playbooks/os-senlin-install.yml @@ -16,6 +16,10 @@ - name: Gather senlin facts hosts: senlin_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -31,11 +35,6 @@ tags: - senlin pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - # In order to ensure that any container, software or # config file changes which causes a container/service # restart do not cause an unexpected outage, we drain diff --git a/playbooks/os-swift-install.yml b/playbooks/os-swift-install.yml index 62f9de5504..5ac68cd127 100644 --- a/playbooks/os-swift-install.yml +++ b/playbooks/os-swift-install.yml @@ -16,6 +16,10 @@ - name: Gather swift facts hosts: swift_all:swift_remote_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -27,11 +31,6 @@ - "defaults/repo_packages/openstack_services.yml" - "defaults/{{ install_method }}_install.yml" pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" vars: extra_container_config_no_restart: diff --git a/playbooks/os-tacker-install.yml b/playbooks/os-tacker-install.yml index 33675dc173..b2a2e437eb 100644 --- a/playbooks/os-tacker-install.yml +++ b/playbooks/os-tacker-install.yml @@ -16,6 +16,10 @@ - name: Gather tacker facts hosts: tacker_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -31,11 +35,6 @@ tags: - tacker pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal roles: diff --git a/playbooks/os-tempest-install.yml b/playbooks/os-tempest-install.yml index b36c2e8578..5b8d77cd49 100644 --- a/playbooks/os-tempest-install.yml +++ b/playbooks/os-tempest-install.yml @@ -16,6 +16,10 @@ - name: Gather tempest facts hosts: utility_all[0] gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -33,11 +37,6 @@ when: - (not (tempest_install | default(false)) | bool) - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - roles: - role: "os_tempest" - role: "openstack.osa.system_crontab_coordination" diff --git a/playbooks/os-trove-install.yml b/playbooks/os-trove-install.yml index 1b2cdca5e0..ba5200a89d 100644 --- a/playbooks/os-trove-install.yml +++ b/playbooks/os-trove-install.yml @@ -19,6 +19,10 @@ - name: Gather trove facts hosts: trove_all gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -34,11 +38,6 @@ tags: - trove pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" when: not is_metal diff --git a/playbooks/os-zun-install.yml b/playbooks/os-zun-install.yml index 39584b9d03..7fa8e6d52f 100644 --- a/playbooks/os-zun-install.yml +++ b/playbooks/os-zun-install.yml @@ -16,6 +16,10 @@ - name: Gather zun facts hosts: zun gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + when: osa_gather_facts | default(True) tags: - always @@ -28,11 +32,6 @@ - "defaults/repo_packages/openstack_services.yml" - "defaults/{{ install_method }}_install.yml" pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - tags: - - always - # In order to ensure that any container, software or # config file changes which causes a container/service # restart do not cause an unexpected outage, we drain diff --git a/playbooks/security-hardening.yml b/playbooks/security-hardening.yml index 66835f5321..667a508e7a 100644 --- a/playbooks/security-hardening.yml +++ b/playbooks/security-hardening.yml @@ -20,6 +20,13 @@ - name: Gather security hardening facts hosts: "{{ security_host_group|default('hosts') }}" gather_facts: "{{ osa_gather_facts | default(True) }}" + tasks: + - name: Gather additional facts + include_tasks: "common-tasks/gather-hardware-facts.yml" + vars: + deployment_extra_facts_filter: ansible_mounts + deployment_extra_facts_subset: "!all,hardware" + when: osa_gather_facts | default(True) tags: - always @@ -28,13 +35,6 @@ gather_facts: false user: root pre_tasks: - - name: Gather additional facts - include_tasks: "common-tasks/gather-hardware-facts.yml" - vars: - deployment_extra_facts_filter: ansible_mounts - deployment_extra_facts_subset: "!all,hardware" - tags: - - always roles: - role: "ansible-hardening" when: apply_security_hardening | bool diff --git a/releasenotes/notes/facts_gathering_tags-69babd74af6e7470.yaml b/releasenotes/notes/facts_gathering_tags-69babd74af6e7470.yaml new file mode 100644 index 0000000000..c75dd707c2 --- /dev/null +++ b/releasenotes/notes/facts_gathering_tags-69babd74af6e7470.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Fixed facts gathering when tags were provided with playbook run.