Skip to content

Commit 15daff1

Browse files
committed
[DEPRECATION WARNING]: evaluating variables as a bare variable.
Might be confusing. This behaviour will go away and you might need to add |bool to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration toggle... This feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
1 parent 7095a2c commit 15daff1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tasks/main.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
until: network_access is success
99
retries: 10
1010
delay: 2
11-
when: collections_enabled and ansible_distribution == 'CentOS'
11+
when: collections_enabled|bool and ansible_distribution == 'CentOS'
1212
tags:
1313
- git
1414
- base_git
1515

1616
- name: enable rhel software collections
1717
command: "yum-config-manager --enable rhel-server-rhscl-{{ ansible_distribution_major_version }}-rpms"
18-
when: collections_enabled and ansible_distribution == 'Red Hat Enterprise Linux'
18+
when: collections_enabled|bool and ansible_distribution == 'Red Hat Enterprise Linux'
1919
tags:
2020
- git
2121
- base_git
2222

2323
- name: Install Git software collection
2424
become: yes
25-
when: collections_enabled and ansible_os_family == 'RedHat'
25+
when: collections_enabled|bool and ansible_os_family == 'RedHat'
2626
yum:
2727
name: "{{ base_git_rpms }}"
2828
state: present
@@ -40,7 +40,7 @@
4040
src: "/opt/rh/{{ base_git }}/enable"
4141
path: /etc/profile.d/rh-git.sh
4242
state: link
43-
when: collections_enabled and ansible_os_family == 'RedHat'
43+
when: collections_enabled|bool and ansible_os_family == 'RedHat'
4444
tags:
4545
- git
4646
- base_git
@@ -49,21 +49,21 @@
4949
file:
5050
path: /etc/profile.d/rh-git.sh
5151
state: absent
52-
when: not collections_enabled and ansible_os_family == 'RedHat'
52+
when: not collections_enabled|bool and ansible_os_family == 'RedHat'
5353
tags:
5454
- git
5555

5656
- name: Disable Git software collection
5757
file:
5858
path: /etc/profile.d/rh-git.sh
5959
state: absent
60-
when: not collections_enabled and ansible_os_family == 'RedHat'
60+
when: not collections_enabled|bool and ansible_os_family == 'RedHat'
6161
tags:
6262
- git
6363

6464
- name: Install Git from yum repo
6565
become: yes
66-
when: not collections_enabled and ansible_os_family == 'RedHat'
66+
when: not collections_enabled|bool and ansible_os_family == 'RedHat'
6767
yum:
6868
name: git
6969
state: present
@@ -95,7 +95,7 @@
9595
src: "/opt/rh/{{ base_git }}/enable"
9696
path: /etc/profile.d/rh-git.sh
9797
state: absent
98-
when: not collections_enabled and ansible_os_family == 'RedHat'
98+
when: not collections_enabled|bool and ansible_os_family == 'RedHat'
9999
tags:
100100
- git
101101
- base_git

0 commit comments

Comments
 (0)