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 <[email protected]> Signed-off-by: Philipp Funk <[email protected]> Co-authored-by: Philipp Funk <[email protected]>
20 lines
512 B
YAML
20 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'
|