file integration test - cleanup testing users and group
This commit is contained in:
parent
5b8fb4dcd3
commit
0467b1d477
19
test/integration/targets/file/handlers/main.yml
Normal file
19
test/integration/targets/file/handlers/main.yml
Normal file
|
@ -0,0 +1,19 @@
|
|||
- name: remove users
|
||||
user:
|
||||
name: "{{ item }}"
|
||||
state: absent
|
||||
remove: yes
|
||||
loop:
|
||||
- test1
|
||||
- test_uid
|
||||
- nonexistent
|
||||
- "{{ remote_unprivileged_user }}"
|
||||
|
||||
- name: remove groups
|
||||
group:
|
||||
name: "{{ item }}"
|
||||
state: absent
|
||||
loop:
|
||||
- test1
|
||||
- test_gid
|
||||
- nonexistent1
|
|
@ -183,11 +183,13 @@
|
|||
user:
|
||||
name: test1
|
||||
uid: 1234
|
||||
notify: remove users
|
||||
|
||||
- name: create group
|
||||
group:
|
||||
name: test1
|
||||
gid: 1234
|
||||
notify: remove groups
|
||||
|
||||
- name: change ownership and group
|
||||
file: path={{output_dir}}/baz.txt owner=1234 group=1234
|
||||
|
@ -604,6 +606,7 @@
|
|||
- name: create owner
|
||||
user:
|
||||
name: nonexistent
|
||||
notify: remove users
|
||||
|
||||
# I don't use state=touch here intentionally to fail and catch warnings
|
||||
- name: owner exist in check_mode
|
||||
|
@ -627,6 +630,7 @@
|
|||
user:
|
||||
name: test_uid
|
||||
uid: 111111
|
||||
notify: remove users
|
||||
|
||||
# I don't use state=touch here intentionally to fail and catch warnings
|
||||
- name: owner exists in check_mode, using uid
|
||||
|
@ -650,6 +654,7 @@
|
|||
- name: create group
|
||||
group:
|
||||
name: nonexistent1
|
||||
notify: remove groups
|
||||
|
||||
# I don't use state=touch here intentionally to fail and catch warnings
|
||||
- name: group exists in check_mode
|
||||
|
@ -673,6 +678,7 @@
|
|||
group:
|
||||
name: test_gid
|
||||
gid: 111112
|
||||
notify: remove groups
|
||||
|
||||
# I don't use state=touch here intentionally to fail and catch warnings
|
||||
- name: group exists in check_mode, using gid
|
||||
|
|
|
@ -125,6 +125,7 @@
|
|||
user:
|
||||
name: '{{ remote_unprivileged_user }}'
|
||||
register: user
|
||||
notify: remove users
|
||||
|
||||
- name: Create a local temporary directory
|
||||
tempfile:
|
||||
|
|
Loading…
Reference in a new issue