This commit is contained in:
parent
82bdb9a37d
commit
806565d2b3
1 changed files with 32 additions and 30 deletions
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
- block:
|
||||
- name: base setup
|
||||
block:
|
||||
- name: Include vars for {{ ansible_os_family }}
|
||||
ansible.builtin.include_vars: "{{ ansible_os_family }}_{{ ansible_distribution_major_version }}.yml"
|
||||
|
||||
|
|
@ -179,36 +180,37 @@
|
|||
regexp: '^#compress'
|
||||
replace: 'compress'
|
||||
|
||||
- block:
|
||||
- name: Verify if hosts.deny TCP_Wrappers file exists
|
||||
ansible.builtin.stat:
|
||||
path: "/etc/hosts.deny"
|
||||
register: hostsdeny
|
||||
check_mode: false
|
||||
- name: Verify if hosts.allow TCP_Wrappers file exists
|
||||
ansible.builtin.stat:
|
||||
path: "/etc/hosts.allow"
|
||||
register: hostsallow
|
||||
check_mode: false
|
||||
- name: TCPWrapper setup
|
||||
block:
|
||||
- name: Verify if hosts.deny TCP_Wrappers file exists
|
||||
ansible.builtin.stat:
|
||||
path: "/etc/hosts.deny"
|
||||
register: hostsdeny
|
||||
check_mode: false
|
||||
- name: Verify if hosts.allow TCP_Wrappers file exists
|
||||
ansible.builtin.stat:
|
||||
path: "/etc/hosts.allow"
|
||||
register: hostsallow
|
||||
check_mode: false
|
||||
|
||||
- name: Install hosts.deny TCP_Wrappers file
|
||||
ansible.builtin.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
|
||||
ansible.builtin.copy:
|
||||
src: "hosts.allow"
|
||||
dest: "/etc/hosts.allow"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when:
|
||||
- not hostsallow.stat.exists
|
||||
- name: Install hosts.deny TCP_Wrappers file
|
||||
ansible.builtin.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
|
||||
ansible.builtin.copy:
|
||||
src: "hosts.allow"
|
||||
dest: "/etc/hosts.allow"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when:
|
||||
- not hostsallow.stat.exists
|
||||
when:
|
||||
- ansible_os_family == "RedHat"
|
||||
- ansible_distribution_major_version < '9'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue