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
This commit is contained in:
James Slagle 2019-06-07 10:23:36 -04:00 committed by Emilien Macchi
parent 76b836e1a5
commit 203418529a
2 changed files with 30 additions and 26 deletions

View File

@ -296,14 +296,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
@ -313,7 +313,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
@ -323,7 +323,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
@ -355,7 +355,7 @@ outputs:
- hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
name: Server pre deployment steps
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
tasks:
{%- for role in roles %}
@ -374,7 +374,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
@ -387,7 +387,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
@ -413,7 +413,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:
@ -437,7 +437,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,
@ -472,7 +472,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
@ -502,7 +502,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
@ -515,7 +515,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:
@ -571,14 +571,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
@ -631,14 +631,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:
@ -654,7 +654,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:
@ -686,13 +686,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
@ -727,7 +727,7 @@ outputs:
- hosts: all
name: Load global variables
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
tasks:
- include_vars: global_vars.yaml
- name: ensure we get the right selinux context
@ -741,7 +741,7 @@ outputs:
- hosts: DEPLOY_TARGET_HOST
name: Upgrade tasks for step {{step}}
gather_facts: no
gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
any_errors_fatal: yes
vars:
bootstrap_server_id: BOOTSTRAP_SERVER_ID
@ -833,14 +833,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:
@ -868,7 +868,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:
@ -926,14 +926,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_TARGET_HOST
name: Scaling
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.