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
This commit is contained in:
Alex Schultz 2019-06-11 14:14:07 -06:00
parent 948657a523
commit 067473ca59
1 changed files with 10 additions and 10 deletions

View File

@ -83,7 +83,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:
@ -92,7 +92,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:
@ -106,12 +106,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: "Template deployment file for {{ item }}"
template:
@ -154,7 +154,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
@ -178,7 +178,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: |
@ -189,7 +189,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) }}"
@ -201,7 +201,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:
@ -211,7 +211,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:
@ -219,5 +219,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