Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit fd497bb

Browse files
committed
install python27 on centos6 with collections_enabled
1 parent fd98dbe commit fd497bb

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

defaults/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ collections_enabled: true
66
# python2 is deprecated.
77
base_python_version: 3
88

9-
# python2 is deprecated, python27 allowed on Centos 6
10-
# These are installed on Centos 6 when collections_enabled: false
11-
python_rhel:
9+
# python26 is obsolete, python27 legacy on Centos 6
10+
# These are installed on Centos 6 when collections_enabled: true
11+
python27_rhel:
1212
- python27
1313
- python27-python-devel
1414
- python27-python-pip

tasks/python-RedHat.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,6 @@
88
tags:
99
- skip_ansible_lint
1010

11-
- name: 'install python_rpms from rhel repositories'
12-
become: yes
13-
when:
14-
- not collections_enabled
15-
- ansible_distribution_major_version|int == 6
16-
yum:
17-
name: "{{ python_rhel }}"
18-
state: present
19-
update_cache: yes
20-
tags:
21-
- base_python
22-
2311
- name: 'install python_rpms from epel repositories'
2412
become: yes
2513
when:
@@ -37,13 +25,25 @@
3725
package:
3826
name: centos-release-scl-rh
3927
state: present
40-
when: collections_enabled and ansible_distribution == 'CentOS'
28+
when: collections_enabled|bool and ansible_distribution == 'CentOS'
4129
tags:
4230
- base_python
4331

4432
- name: 'enable rhel software collections'
4533
command: "yum-config-manager --enable rhel-server-rhscl-{{ ansible_distribution_major_version }}-rpms"
46-
when: collections_enabled and ansible_distribution == 'Red Hat Enterprise Linux'
34+
when: collections_enabled|bool and ansible_distribution == 'Red Hat Enterprise Linux'
35+
tags:
36+
- base_python
37+
38+
- name: 'install python27_rpms from rhel software collections'
39+
become: yes
40+
when:
41+
- collections_enabled|bool
42+
- ansible_distribution_major_version|int == 6
43+
yum:
44+
name: "{{ python27_rhel }}"
45+
state: present
46+
update_cache: yes
4747
tags:
4848
- base_python
4949

0 commit comments

Comments
 (0)