Skip to content

Commit 515037d

Browse files
committed
remove /etc/profile.d/rh-git.sh when collections_enabled: false
1 parent a351c4a commit 515037d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tasks/main.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
when: collections_enabled and ansible_distribution == 'CentOS'
88
tags:
99
- git
10+
- base_git
1011

1112
- name: enable rhel software collections
1213
command: "yum-config-manager --enable rhel-server-rhscl-{{ ansible_distribution_major_version }}-rpms"
1314
when: collections_enabled and ansible_distribution == 'Red Hat Enterprise Linux'
1415
tags:
1516
- git
17+
- base_git
1618

1719
- name: Install Git software collection
1820
become: yes
@@ -23,6 +25,7 @@
2325
update_cache: yes
2426
tags:
2527
- git
28+
- base_git
2629

2730
- name: Enable Git software collection
2831
file:
@@ -32,6 +35,7 @@
3235
when: collections_enabled and ansible_os_family == 'RedHat'
3336
tags:
3437
- git
38+
- base_git
3539

3640
- name: Install Git from yum repo
3741
become: yes
@@ -42,6 +46,7 @@
4246
update_cache: yes
4347
tags:
4448
- git
49+
- base_git
4550

4651
- name: Install Git from apt repo
4752
become: yes
@@ -51,3 +56,14 @@
5156
state: present
5257
tags:
5358
- git
59+
- base_git
60+
61+
- name: Disable Git software collection
62+
file:
63+
src: "/opt/rh/{{ base_git }}/enable"
64+
path: /etc/profile.d/rh-git.sh
65+
state: absent
66+
when: not collections_enabled and ansible_os_family == 'RedHat'
67+
tags:
68+
- git
69+
- base_git

0 commit comments

Comments
 (0)