ansible-collection-hardening/roles/os_hardening/tasks/rhosts.yml
2020-11-07 22:09:28 +01:00

23 lines
611 B
YAML

---
- name: Get user accounts | os-09
command: "awk -F: '{print $1}' /etc/passwd"
changed_when: false
check_mode: false
register: users_accounts
- name: delete rhosts-files from system | os-09
file:
dest: '~{{ item }}/.rhosts'
state: 'absent'
with_flattened: '{{ users_accounts.stdout_lines | default([]) }}'
- name: delete hosts.equiv from system | os-01
file:
dest: '/etc/hosts.equiv'
state: 'absent'
- name: delete .netrc-files from system | os-09
file:
dest: '~{{ item }}/.netrc'
state: 'absent'
with_flattened: '{{ users_accounts.stdout_lines | default([]) }}'