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
This commit is contained in:
Dmitriy Rabotyagov 2022-03-25 19:56:44 +01:00
parent 6ae7806fdd
commit 2492d82da6
32 changed files with 149 additions and 153 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,6 +36,10 @@
pre_tasks:
- name: Gather additional facts
include_tasks: "common-tasks/gather-hardware-facts.yml"
args:
apply:
tags:
- always
tags:
- always

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,4 @@
---
fixes:
- |
Fixed facts gathering when tags were provided with playbook run.