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