Skip to content

Commit 73ce88a

Browse files
committed
Use the RedHat Software Collections on-premise.
1 parent 7b7764d commit 73ce88a

File tree

4 files changed

+54
-4
lines changed

4 files changed

+54
-4
lines changed

defaults/main.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Software collections offer latest versions of programming languages
2+
collections_enabled: false
3+
4+
# The file that needs the next line
5+
# scl enable rh-git218 bash
6+
collections_rc_file: /etc/skel/.bashrc
7+
8+
# When collections is enabled this is the git you get
9+
base_git: rh-git218
10+
11+
base_git_rpms:
12+
- "{{ base_git }}"
13+
- "{{ base_git }}-git-subtree"
14+
- "{{ base_git }}-git-lfs"
15+
- "{{ base_git }}-git-svn"
16+
- "{{ base_git }}-perl-Git-SVN"
17+
- "{{ base_git }}-git-cvs"
18+
- "{{ base_git }}-git-p4"

molecule/default/molecule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ platforms:
1313
- name: base-git-ubuntu
1414
image: ubuntu
1515
privileged: True
16-
- name: base-git-debian
17-
image: maint/debian-systemd
18-
privileged: True
1916
provisioner:
2017
name: ansible
2118
config_options:

molecule/default/playbook.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
# Standards: 0.2
33
- hosts: all
4+
vars:
5+
collections_enabled: true
46
roles:
57
- role: base_git

tasks/main.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,41 @@
11
---
22

3+
- name: install centos software collections
4+
package:
5+
name: centos-release-scl-rh
6+
state: present
7+
when: collections_enabled and ansible_distribution == 'CentOS'
8+
tags:
9+
- git
10+
11+
- name: enable rhel software collections
12+
command: "yum-config-manager --enable rhel-server-rhscl-{{ ansible_distribution_major_version }}-rpms"
13+
when: collections_enabled and ansible_distribution == 'Red Hat Enterprise Linux'
14+
tags:
15+
- git
16+
17+
- name: Install Git software collection
18+
become: yes
19+
when: collections_enabled and ansible_os_family == 'RedHat'
20+
yum:
21+
name: "{{ base_git_rpms }}"
22+
state: present
23+
update_cache: yes
24+
tags:
25+
- git
26+
27+
- name: Enable Git software collection
28+
file:
29+
src: "/opt/rh/{{ base_git }}/enable"
30+
path: /etc/profile.d/rh-git.sh
31+
state: link
32+
when: collections_enabled and ansible_os_family == 'RedHat'
33+
tags:
34+
- git
35+
336
- name: Install Git from yum repo
437
become: yes
5-
when: ansible_os_family == 'RedHat'
38+
when: not collections_enabled and ansible_os_family == 'RedHat'
639
yum:
740
name: git
841
state: present

0 commit comments

Comments
 (0)