Replace hardcoded gather_facts:no with variable

Use a gather_facts variable to control fact gathering at the play level
instead of just the hardcoded gather_facts:no.

This allows for forcing facts to be gathered during a play if the
earlier fact gathering tasks had been skipped (such as when using
--start-at-task).

Change-Id: I2b7625baac4a09413cc50b84d2df1c00ec14b00a
(cherry picked from commit 203418529a)
This commit is contained in:
James Slagle 2019-06-07 10:23:36 -04:00
parent 2871ce0fa9
commit c3644ab44f
2 changed files with 25 additions and 21 deletions

View File

@ -272,14 +272,14 @@ outputs:
- hosts: all
name: Load global variables
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
tasks:
- include_vars: global_vars.yaml
tags:
- always
- hosts: all
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
name: Manage SELinux
tasks:
- name: Set selinux state
@ -289,7 +289,7 @@ outputs:
- hosts: DEPLOY_TARGET_HOST
name: Common roles for TripleO servers
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
roles:
- tripleo-bootstrap
@ -299,7 +299,7 @@ outputs:
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Overcloud deploy step tasks for step 0
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
@ -331,7 +331,7 @@ outputs:
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Server deployments
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
tasks:
- include_tasks: deployments.yaml
@ -344,7 +344,7 @@ outputs:
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Host prep steps
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
@ -370,7 +370,7 @@ outputs:
- hosts: DEPLOY_SOURCE_HOST
name: External deployment step {{step}}
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
become: false
vars:
@ -394,7 +394,7 @@ outputs:
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Overcloud deploy step tasks for {{step}}
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
# FIXME(shardy) - it would be nice to use strategy: free to
# allow the tasks per-step to run in parallel on each role,
@ -429,7 +429,7 @@ outputs:
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Overcloud common deploy step tasks {{step}}
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
@ -459,7 +459,7 @@ outputs:
{%- endfor %}
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Server Post Deployments
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
tasks:
- include_tasks: deployments.yaml
@ -472,7 +472,7 @@ outputs:
- hosts: DEPLOY_SOURCE_HOST
name: External deployment Post Deploy tasks
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
become: false
vars:
@ -525,14 +525,14 @@ outputs:
gather_facts: yes
- hosts: all
name: Load global variables
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
tasks:
- include_vars: global_vars.yaml
{%- for role in roles %}
- hosts: {{role.name}}
name: Run update
serial: {{ role.update_serial | default(1) }}
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
@ -585,14 +585,14 @@ outputs:
- facts
- hosts: all
name: Load global variables
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
tasks:
- include_vars: global_vars.yaml
tags:
- always
- hosts: DEPLOY_SOURCE_HOST
name: External update steps
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
become: false
tasks:
@ -608,7 +608,7 @@ outputs:
# variables "exported" from update tasks
- hosts: DEPLOY_SOURCE_HOST
name: External deploy steps
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
become: false
tasks:
@ -640,13 +640,13 @@ outputs:
gather_facts: yes
- hosts: all
name: Load global variables
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
tasks:
- include_vars: global_vars.yaml
- hosts: {{role.name}}
name: Run pre-upgrade rolling tasks
serial: {{ role.deploy_serial | default(1) }}
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
tasks:
- include_tasks: pre_upgrade_rolling_steps_tasks.yaml
@ -774,14 +774,14 @@ outputs:
- facts
- hosts: all
name: Load global variables
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
tasks:
- include_vars: global_vars.yaml
tags:
- always
- hosts: DEPLOY_SOURCE_HOST
name: External upgrade
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
become: false
vars:
@ -812,7 +812,7 @@ outputs:
# variables "exported" from upgrade tasks
- hosts: DEPLOY_SOURCE_HOST
name: External deploy steps
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
become: false
vars:

View File

@ -0,0 +1,4 @@
---
features:
- When running config-download manually, fact gathering at the play level can
now be controlled with the gather_facts Ansible boolean variable.