]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
container: add always tag on gather fact tasks v3.2.36
authorDimitri Savineau <dsavinea@redhat.com>
Thu, 14 Nov 2019 14:29:29 +0000 (09:29 -0500)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 18 Nov 2019 15:42:47 +0000 (16:42 +0100)
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 d7fd769b6ddcb63086cc414e00cce31433d56673)

site-docker.yml.sample

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