mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
777 B
YAML
23 lines
777 B
YAML
4 years ago
|
- hosts: testhost
|
||
|
gather_facts: no
|
||
|
tasks:
|
||
|
- name: make sure the nobody user is available
|
||
|
include_role:
|
||
|
name: setup_nobody
|
||
|
|
||
|
- name: verify AnsibleModule works when cwd is missing
|
||
|
test_cwd_missing:
|
||
|
register: missing
|
||
|
|
||
|
- name: verify AnsibleModule works when cwd is unreadable
|
||
|
test_cwd_unreadable:
|
||
|
register: unreadable
|
||
|
become: yes
|
||
|
become_user: nobody # root can read cwd regardless of permissions, so a non-root user is required here
|
||
|
|
||
|
- name: verify AnsibleModule was able to adjust cwd as expected
|
||
|
assert:
|
||
|
that:
|
||
|
- missing.before != missing.after
|
||
|
- unreadable.before != unreadable.after or unreadable.before == '/' # allow / fallback on macOS when using an unprivileged user
|