forked from ansible-lockdown/RHEL9-CIS
Initial
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
commit
a54b5216eb
87 changed files with 7693 additions and 0 deletions
36
tasks/check_prereqs.yml
Normal file
36
tasks/check_prereqs.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
|
||||
- name: "PREREQ | Add the required packages | Python 3"
|
||||
block:
|
||||
- name: Check if python36-rpm package installed
|
||||
command: rpm -q python36-rpm
|
||||
failed_when: ( python36_rpm_present.rc not in [ 0, 1 ] )
|
||||
changed_when: false
|
||||
args:
|
||||
warn: false
|
||||
register: python36_rpm_present
|
||||
|
||||
- name: Add the EPEL repository required for the python36-rpm pkg
|
||||
package:
|
||||
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
|
||||
state: present
|
||||
register: epel_installed
|
||||
when:
|
||||
- python36_rpm_present.rc != '0'
|
||||
|
||||
- name: "PREREQ | Check required packages installed | Python3 "
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
register: python3reqs_installed
|
||||
loop:
|
||||
- python36-rpm
|
||||
- libselinux-python3
|
||||
|
||||
- name: Disable Epel repo if installed earlier
|
||||
command: yum-config-manager disable epel
|
||||
when: epel_installed.changed
|
||||
when:
|
||||
- ( ansible_python.version.major == 3 and ansible_python.version.minor == 6 )
|
||||
vars:
|
||||
ansible_python_interpreter: "{{ python2_bin }}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue