Files
ansible-collection-hardening/molecule/os_hardening/verify_tasks/netrc.yml
T
2023-12-06 14:37:09 +01:00

20 lines
502 B
YAML

---
- name: Test that .netrc in root homedir exists
ansible.builtin.file:
path: /root/.netrc
state: file
register: result_test_netrc
- name: Output result if .netrc for user root exists
ansible.builtin.assert:
that:
- result_test_netrc.state == 'file'
fail_msg: .netrc in /root/ not present
success_msg: .netrc exists in /root/
- name: Delete '.netrc' in /root
ansible.builtin.file:
path: /root/.netrc
state: absent
when: result_test_netrc.state == 'file'