Merge pull request 'Other EL 7 vs 8 pkg names differences.' (!241) from adellam/ansible-roles:master into master

Reviewed-on: ISTI-ansible-roles/ansible-roles#241
This commit is contained in:
Andrea Dell'Amico 2021-12-03 13:18:39 +01:00
commit 49b9e57de1
2 changed files with 21 additions and 2 deletions

View File

@ -18,6 +18,10 @@ el_dnf_automation: False
centos8_packages_automation: centos8_packages_automation:
- dnf-automatic - dnf-automatic
centos7_packages_to_install:
- policycoreutils-python
centos8_packages_to_install:
- policycoreutils-python-utils
centos_packages_to_install: centos_packages_to_install:
- dstat - dstat
- lsof - lsof
@ -26,7 +30,6 @@ centos_packages_to_install:
- bind-utils - bind-utils
- whois - whois
- iotop - iotop
- policycoreutils-python
- firewalld - firewalld
- ipset - ipset
- psmisc - psmisc

View File

@ -1,8 +1,24 @@
--- ---
- name: Install the basic packages - name: Install the basic packages commont to CentOS 7 and 8+
yum: name={{ centos_packages_to_install }} state={{ centos_pkg_state }} yum: name={{ centos_packages_to_install }} state={{ centos_pkg_state }}
tags: [ 'centos', 'bootstrap', 'packages' ] tags: [ 'centos', 'bootstrap', 'packages' ]
- name: Install CentOS 7 packages
yum:
pkg: '{{ centos7_packages_to_install }}'
state: present
when:
- ansible_distribution_file_variety == "RedHat"
- ansible_distribution_major_version is version_compare('7', '<=')
- name: Install CentOS 8 packages
dnf:
pkg: '{{ centos8_packages_to_install }}'
state: present
when:
- ansible_distribution_file_variety == "RedHat"
- ansible_distribution_major_version is version_compare('8', '>=')
- name: Install the packages to automate some yum tasks on CentOS 7 - name: Install the packages to automate some yum tasks on CentOS 7
yum: yum:
pkg: '{{ centos7_packages_automation }}' pkg: '{{ centos7_packages_automation }}'