Skip to content

Commit 6712c91

Browse files
committed
No more Software Collections
1 parent 9b6d4de commit 6712c91

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

tasks/main.yml

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,31 @@
88
until: network_access is success
99
retries: 10
1010
delay: 2
11-
when: collections_enabled|bool and ansible_distribution == 'CentOS'
11+
when:
12+
- collections_enabled|bool
13+
- ansible_distribution == 'CentOS'
14+
- ansible_distribution_major_version|int <= 7
1215
tags:
1316
- git
1417
- base_git
1518

1619
- name: enable rhel software collections
1720
# yamllint disable-line rule:line-length
1821
command: "yum-config-manager --enable rhel-server-rhscl-{{ ansible_distribution_major_version }}-rpms"
19-
when: collections_enabled|bool and ansible_distribution == 'RedHat'
22+
when:
23+
- collections_enabled|bool
24+
- ansible_distribution == 'RedHat'
25+
- ansible_distribution_major_version|int <= 7
2026
tags:
2127
- git
2228
- base_git
2329

2430
- name: Set git
2531
set_fact:
26-
base_git: rh-git29
32+
base_git: git
2733
when:
2834
- ansible_os_family == 'RedHat'
29-
- ansible_distribution_major_version|int == 6
35+
- ansible_distribution_major_version|int > 7
3036
tags:
3137
- git
3238
- base_git
@@ -41,6 +47,16 @@
4147
- git
4248
- base_git
4349

50+
- name: Set git
51+
set_fact:
52+
base_git: rh-git29
53+
when:
54+
- ansible_os_family == 'RedHat'
55+
- ansible_distribution_major_version|int == 6
56+
tags:
57+
- git
58+
- base_git
59+
4460
- name: Set git packages
4561
when: collections_enabled|bool and ansible_os_family == 'RedHat'
4662
set_fact:
@@ -56,7 +72,10 @@
5672

5773
- name: Install Git software collection
5874
become: true
59-
when: collections_enabled|bool and ansible_os_family == 'RedHat'
75+
when:
76+
- collections_enabled|bool
77+
- ansible_os_family == 'RedHat'
78+
- ansible_distribution_major_version|int <= 7
6079
yum:
6180
name: "{{ base_git_rpms }}"
6281
state: present
@@ -88,7 +107,7 @@
88107
tags:
89108
- git
90109
- base_git
91-
- notest
110+
# - notest
92111

93112
- name: Disable Git software collection
94113
file:
@@ -107,26 +126,9 @@
107126
tags:
108127
- git
109128

110-
- name: Install Git from yum repo
111-
become: true
112-
# yamllint disable-line rule:line-length
113-
when: (ansible_os_family == 'RedHat') and (not collections_enabled|bool or rhgit_install is failed)
114-
yum:
115-
name: git
116-
state: present
117-
update_cache: true
118-
register: network_access
119-
until: network_access is success
120-
retries: 10
121-
delay: 2
122-
tags:
123-
- git
124-
- base_git
125-
126-
- name: Install Git from apt repo
129+
- name: Install Git
127130
become: true
128-
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
129-
apt:
131+
package:
130132
name: git
131133
state: present
132134
update_cache: true

0 commit comments

Comments
 (0)