container: add always tag on gather fact tasks

If we execute the site-container.yml playbook with specific tags (like
ceph_update_config) then we need to be sure to gather the facts otherwise
we will see error like:

The task includes an option with an undefined variable. The error was:
'ansible_hostname' is undefined

This commit also adds missing 'gather_facts: false' to mons plays.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1754432

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit d7fd769b6d)
pull/4758/head v3.2.36
Dimitri Savineau 2019-11-14 09:29:29 -05:00 committed by Guillaume Abrioux
parent c67de5a342
commit 25ac0efddd
1 changed files with 8 additions and 8 deletions

View File

@ -24,8 +24,8 @@
pre_tasks: pre_tasks:
- name: gather facts - name: gather facts
setup: setup:
when: when: not delegate_facts_host | bool
- not delegate_facts_host | bool tags: always
- name: gather and delegate facts - name: gather and delegate facts
setup: setup:
@ -33,21 +33,19 @@
delegate_facts: True delegate_facts: True
with_items: "{{ groups['all'] }}" with_items: "{{ groups['all'] }}"
run_once: true run_once: true
when: when: delegate_facts_host | bool
- delegate_facts_host | bool tags: always
- name: check if it is atomic host - name: check if it is atomic host
stat: stat:
path: /run/ostree-booted path: /run/ostree-booted
register: stat_ostree register: stat_ostree
tags: tags: always
- always
- name: set_fact is_atomic - name: set_fact is_atomic
set_fact: set_fact:
is_atomic: '{{ stat_ostree.stat.exists }}' is_atomic: '{{ stat_ostree.stat.exists }}'
tags: tags: always
- always
roles: roles:
- role: ceph-defaults - role: ceph-defaults
@ -74,6 +72,7 @@
- hosts: mons - hosts: mons
any_errors_fatal: true any_errors_fatal: true
gather_facts: false
tasks: tasks:
- name: set ceph monitor install 'In Progress' - name: set ceph monitor install 'In Progress'
run_once: true run_once: true
@ -102,6 +101,7 @@
- hosts: mons - hosts: mons
any_errors_fatal: true any_errors_fatal: true
gather_facts: false
tasks: tasks:
- name: set ceph monitor install 'Complete' - name: set ceph monitor install 'Complete'
run_once: true run_once: true