From 84e84f9d936e198acbf05a1d8a256075ab0545f1 Mon Sep 17 00:00:00 2001 From: Adrien Date: Mon, 13 Apr 2020 00:40:27 +0200 Subject: [PATCH] Update for CentOS 8 --- tasks/main.yml | 58 +++++++++++++++++-------------- vars/{RedHat.yml => RedHat_7.yml} | 0 vars/RedHat_8.yml | 31 +++++++++++++++++ 3 files changed, 63 insertions(+), 26 deletions(-) rename vars/{RedHat.yml => RedHat_7.yml} (100%) create mode 100644 vars/RedHat_8.yml diff --git a/tasks/main.yml b/tasks/main.yml index 898c525..6d9edec 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Include vars for {{ ansible_os_family }} - include_vars: "{{ ansible_os_family }}.yml" + include_vars: "{{ ansible_os_family }}_{{ ansible_distribution_major_version }}.yml" - name: Install EPEL repo definition packages for {{ ansible_os_family }} on x86_64 and aarch64 plateform package: @@ -23,6 +23,7 @@ mode: 0644 when: - ansible_os_family == "RedHat" + - ansible_distribution_major_version = '7' - ansible_machine == "armv7l" # or ansible_machine == "armv6l" @@ -62,6 +63,7 @@ mode: 0644 when: - ansible_os_family == "RedHat" + - ansible_distribution_major_version = '7' - name: upgrade all packages package: @@ -93,31 +95,35 @@ regexp: '^#compress' replace: 'compress' -- name: Verify if hosts.deny TCP_Wrappers file exists - stat: - path: "/etc/hosts.deny" - register: hostsdeny -- name: Verify if hosts.allow TCP_Wrappers file exists - stat: - path: "/etc/hosts.allow" - register: hostsallow +- block: + - name: Verify if hosts.deny TCP_Wrappers file exists + stat: + path: "/etc/hosts.deny" + register: hostsdeny + - name: Verify if hosts.allow TCP_Wrappers file exists + stat: + path: "/etc/hosts.allow" + register: hostsallow -- name: Install hosts.deny TCP_Wrappers file - copy: - src: "hosts.deny" - dest: "/etc/hosts.deny" - owner: root - group: root - mode: 0644 + - name: Install hosts.deny TCP_Wrappers file + copy: + src: "hosts.deny" + dest: "/etc/hosts.deny" + owner: root + group: root + mode: 0644 + when: + - not hostsdeny.stat.exists + - name: Install hosts.allow TCP_Wrappers file + copy: + src: "hosts.allow" + dest: "/etc/hosts.allow" + owner: root + group: root + mode: 0644 + when: + - not hostsallow.stat.exists when: - - not hostsdeny.stat.exists -- name: Install hosts.allow TCP_Wrappers file - copy: - src: "hosts.allow" - dest: "/etc/hosts.allow" - owner: root - group: root - mode: 0644 - when: - - not hostsallow.stat.exists + - ansible_os_family == "RedHat" + - ansible_distribution_major_version < '8' diff --git a/vars/RedHat.yml b/vars/RedHat_7.yml similarity index 100% rename from vars/RedHat.yml rename to vars/RedHat_7.yml diff --git a/vars/RedHat_8.yml b/vars/RedHat_8.yml new file mode 100644 index 0000000..68815fd --- /dev/null +++ b/vars/RedHat_8.yml @@ -0,0 +1,31 @@ +--- +base_packages: + - "@core" + - NetworkManager-team + - NetworkManager-bluetooth + - NetworkManager-wifi + - NetworkManager-wwan +# - aide + - bash-completion + - chrony + - device-mapper-event + - dmidecode + - firewalld + - kexec-tools +# - libcap-ng-utils +# - pigz # epel + - patch + - pciutils + - python3-libselinux + - rng-tools + - rsync + - screen + - usbutils + - wget + - xz +# - yum-cron + +base_packages_servers: + - "@^minimal-environment" + - NetworkManager-config-server + - NetworkManager-dispatcher-routing-rules