feat: add test for Rocky Linux 8 #1
@ -1,5 +1,14 @@
|
|||||||
---
|
---
|
||||||
python3_packages:
|
# @var python3_packages:description: >
|
||||||
- python3
|
# The default packages depend on the OS version. For RHEL7 based systems, Python3.8 from
|
||||||
- python3-pip
|
# SCL `centos-sclo-rh`. Therefore, the SCL need to be installed and enabled already!
|
||||||
|
# For RHEL8 based system Python3.9 will be installed from the Appstream repo.
|
||||||
|
# @var python3_packages:default: "_unset_"
|
||||||
|
|
||||||
python3_packages_extra: []
|
python3_packages_extra: []
|
||||||
|
|
||||||
|
# @var python3_packages_remove:description: Optional list of old Pathon packages that should be removed.
|
||||||
|
python3_packages_remove: []
|
||||||
|
|
||||||
|
python3_link_bin: []
|
||||||
|
python3_link_bin_path: /usr/bin
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
---
|
---
|
||||||
- name: Converge
|
- name: Converge
|
||||||
hosts: all
|
hosts: all
|
||||||
|
vars:
|
||||||
|
python3_packages_extra:
|
||||||
|
- centos-release-scl
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: xoxys.python3
|
- role: xoxys.python3
|
||||||
|
@ -1,2 +1,15 @@
|
|||||||
---
|
---
|
||||||
|
- include_vars: "{{ var_files }}"
|
||||||
|
vars:
|
||||||
|
var_files: "{{ lookup('first_found', params, errors='ignore') }}"
|
||||||
|
params:
|
||||||
|
files:
|
||||||
|
- "{{ ansible_lsb.id | default('') | lower }}.yml"
|
||||||
|
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version }}.yml"
|
||||||
|
- "{{ ansible_os_family | lower }}.yml"
|
||||||
|
paths:
|
||||||
|
- "vars"
|
||||||
|
when: var_files
|
||||||
|
|
||||||
|
- include_tasks: overwrites.yml
|
||||||
- include_tasks: setup.yml
|
- include_tasks: setup.yml
|
||||||
|
5
tasks/overwrites.yml
Normal file
5
tasks/overwrites.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: Define python3_packages
|
||||||
|
set_fact:
|
||||||
|
python3_packages: "{{ __python3_packages | list }}"
|
||||||
|
when: python3_packages is not defined
|
@ -5,17 +5,21 @@
|
|||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
loop: "{{ python3_packages_extra + python3_packages }}"
|
loop: "{{ python3_packages_extra + python3_packages }}"
|
||||||
|
|
||||||
- name: Link binaries to '{{ __python3_link_bin_path }}'
|
- name: Remove other Python pckages
|
||||||
|
package:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: absent
|
||||||
|
loop: "{{ python3_packages_remove }}"
|
||||||
|
|
||||||
|
- name: Link binaries to '{{ python3_link_bin_path }}'
|
||||||
file:
|
file:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ __python3_link_bin_path }}/{{ item.dest }}"
|
dest: "{{ python3_link_bin_path }}/{{ item.dest }}"
|
||||||
state: link
|
state: link
|
||||||
force: yes
|
force: yes
|
||||||
loop:
|
loop: "{{ python3_link_bin }}"
|
||||||
- { src: /usr/bin/python3.6, dest: python3 }
|
|
||||||
- { src: /usr/bin/pip3.6, dest: pip3 }
|
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ __python3_link_bin_path }}/{{ item.dest }}"
|
label: "{{ python3_link_bin_path }}/{{ item.dest }}"
|
||||||
become: True
|
become: True
|
||||||
become_user: root
|
become_user: root
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
__python3_link_bin_path: /usr/bin
|
|
4
vars/redhat-7.yml
Normal file
4
vars/redhat-7.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
__python3_packages:
|
||||||
|
- rh-python38
|
||||||
|
- rh-python38-python-pip
|
4
vars/redhat-8.yml
Normal file
4
vars/redhat-8.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
__python3_packages:
|
||||||
|
- python39
|
||||||
|
- python39-pip
|
Loading…
Reference in New Issue
Block a user