Update for CentOS 8

This commit is contained in:
Adrien Reslinger 2020-04-13 00:40:27 +02:00
parent 5eb90966eb
commit 84e84f9d93
3 changed files with 63 additions and 26 deletions

View file

@ -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'