Skip to content

Commit 1361f41

Browse files
committed
defensive for missing rh-git RPM
1 parent f75cf1e commit 1361f41

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tasks/main.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,24 @@
6969
- git
7070
- base_git
7171

72+
- name: Verify environment file
73+
when: ansible_os_family == 'RedHat'
74+
stat:
75+
path: "/opt/rh/{{ base_git }}/enable"
76+
register: rh_git_env
77+
7278
- name: Enable Git software collection
7379
file:
7480
src: "/opt/rh/{{ base_git }}/enable"
7581
path: /etc/profile.d/rh-git.sh
7682
state: link
77-
when: base_git is defined and rhgit_install is success
83+
when:
84+
- ansible_os_family == 'RedHat'
85+
- rh_git_env.stat.exists
7886
tags:
7987
- git
8088
- base_git
89+
- notest
8190

8291
- name: Disable Git software collection
8392
file:
@@ -86,6 +95,7 @@
8695
when: not collections_enabled|bool and ansible_os_family == 'RedHat'
8796
tags:
8897
- git
98+
- notest
8999

90100
- name: Disable Git software collection
91101
file:

0 commit comments

Comments
 (0)