mirror of
https://github.com/dev-sec/ansible-collection-hardening
synced 2024-11-14 02:47:06 +00:00
fd3fc1cfba
add option to whitelist specific user that need a .netrc file in there home dirs add test for .netrc files if option os_netrc_enabled is false Signed-off-by: Philipp Funk <philipp.funk@t-systems.com> Signed-off-by: Philipp Funk <philipp.funk@t-systems.com> Co-authored-by: Philipp Funk <philipp.funk@t-systems.com>
19 lines
512 B
YAML
19 lines
512 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'
|