Fix bare variable usage in ansible

We have some bare variable usages in the deployments.yaml that is
causing a deprecation warning during the deployment. Let's include a
|bool to address these warnings.

Change-Id: I85dfc93eb8afaec3d3157083bcf9605c34a540eb
Closes-Bug: #1832402
(cherry picked from commit 067473ca59)
This commit is contained in:
Alex Schultz 2019-06-11 14:14:07 -06:00
parent 3ff454a870
commit 277902e67e
1 changed files with 10 additions and 10 deletions

View File

@ -68,7 +68,7 @@
loop_var: hieradata_item loop_var: hieradata_item
label: "{{ hieradata_item.path }}" label: "{{ hieradata_item.path }}"
failed_when: false failed_when: false
when: ansible_diff_mode when: ansible_diff_mode|bool
- name: diff hieradata changes for check mode - name: diff hieradata changes for check mode
debug: debug:
@ -77,7 +77,7 @@
changed_when: item.rc == 1 changed_when: item.rc == 1
loop_control: loop_control:
label: "{{ item._ansible_item_label }}" label: "{{ item._ansible_item_label }}"
when: ansible_diff_mode when: ansible_diff_mode|bool
- name: hiera.yaml changes for check mode - name: hiera.yaml changes for check mode
command: command:
@ -91,12 +91,12 @@
debug: debug:
var: diff_results.stdout_lines var: diff_results.stdout_lines
changed_when: diff_results.rc == 1 changed_when: diff_results.rc == 1
when: ansible_diff_mode when: ansible_diff_mode|bool
ignore_errors: yes ignore_errors: yes
when: when:
- deployment_group == 'hiera' - deployment_group == 'hiera'
- ansible_check_mode - ansible_check_mode|bool
- name: "Render deployment file for {{ item }}" - name: "Render deployment file for {{ item }}"
@ -124,7 +124,7 @@
state: absent state: absent
become: true become: true
when: when:
- not ansible_check_mode - not ansible_check_mode|bool
- deployed_file_stat.stat.exists - deployed_file_stat.stat.exists
- previous_deployment_result.rc != 0 - previous_deployment_result.rc != 0
@ -148,7 +148,7 @@
HEAT_SHELL_CONFIG: /var/lib/heat-config/tripleo-config-download/{{ item ~ '-' ~ deployment_uuid }} HEAT_SHELL_CONFIG: /var/lib/heat-config/tripleo-config-download/{{ item ~ '-' ~ deployment_uuid }}
register: deployment_sync_result register: deployment_sync_result
ignore_errors: yes ignore_errors: yes
when: not use_async_deployment when: not use_async_deployment|bool
- name: "Run async deployment {{ item }}" - name: "Run async deployment {{ item }}"
shell: | shell: |
@ -159,7 +159,7 @@
HEAT_SHELL_CONFIG: /var/lib/heat-config/tripleo-config-download/{{ item ~ '-' ~ deployment_uuid }} HEAT_SHELL_CONFIG: /var/lib/heat-config/tripleo-config-download/{{ item ~ '-' ~ deployment_uuid }}
register: deployment_async_result register: deployment_async_result
ignore_errors: yes ignore_errors: yes
when: use_async_deployment when: use_async_deployment|bool
async: "{{ async_timeout | default(300) }}" async: "{{ async_timeout | default(300) }}"
poll: "{{ async_poll | default(3) }}" poll: "{{ async_poll | default(3) }}"
@ -171,7 +171,7 @@
tags: tags:
- output - output
failed_when: deployment_sync_result.rc != 0 failed_when: deployment_sync_result.rc != 0
when: not ansible_check_mode and not use_async_deployment when: not ansible_check_mode|bool and not use_async_deployment|bool
- name: "Output for async deployment {{ item }}" - name: "Output for async deployment {{ item }}"
debug: debug:
@ -181,7 +181,7 @@
tags: tags:
- output - output
failed_when: deployment_async_result.rc != 0 failed_when: deployment_async_result.rc != 0
when: not ansible_check_mode and use_async_deployment when: not ansible_check_mode|bool and use_async_deployment|bool
- name: "Check-mode for Run deployment {{ item }} (changed status indicates deployment would run)" - name: "Check-mode for Run deployment {{ item }} (changed status indicates deployment would run)"
stat: stat:
@ -189,5 +189,5 @@
become: true become: true
register: deploy_exists register: deploy_exists
changed_when: not deploy_exists.stat.exists changed_when: not deploy_exists.stat.exists
when: ansible_check_mode when: ansible_check_mode|bool
ignore_errors: yes ignore_errors: yes