|
|
|
|
@ -2155,15 +2155,18 @@
|
|
|
|
|
- testcase5_stat.results | map(attribute='stat') | map(attribute='gr_name') | unique == [ansible_copy_test_user_name]
|
|
|
|
|
|
|
|
|
|
- command: whoami
|
|
|
|
|
register: who
|
|
|
|
|
register: current_user
|
|
|
|
|
|
|
|
|
|
- command: id -gn
|
|
|
|
|
register: current_group
|
|
|
|
|
|
|
|
|
|
- name: Modify ownership recursively
|
|
|
|
|
copy:
|
|
|
|
|
remote_src: True
|
|
|
|
|
src: '{{ remote_dir_expanded }}/remote_dir_src/'
|
|
|
|
|
dest: '{{ remote_dir_expanded }}/new_dir_with_chown'
|
|
|
|
|
owner: '{{ who.stdout }}'
|
|
|
|
|
group: '{{ who.stdout }}'
|
|
|
|
|
owner: '{{ current_user.stdout }}'
|
|
|
|
|
group: '{{ current_group.stdout }}'
|
|
|
|
|
follow: true
|
|
|
|
|
register: testcase5_updated
|
|
|
|
|
become: true
|
|
|
|
|
@ -2182,8 +2185,8 @@
|
|
|
|
|
- assert:
|
|
|
|
|
that:
|
|
|
|
|
- testcase5_updated is changed
|
|
|
|
|
- testcase5_updated_stat.results | map(attribute='stat') | map(attribute='pw_name') | unique == [who.stdout]
|
|
|
|
|
- testcase5_updated_stat.results | map(attribute='stat') | map(attribute='gr_name') | unique == [who.stdout]
|
|
|
|
|
- testcase5_updated_stat.results | map(attribute='stat') | map(attribute='pw_name') | unique == [current_user.stdout]
|
|
|
|
|
- testcase5_updated_stat.results | map(attribute='stat') | map(attribute='gr_name') | unique == [current_group.stdout]
|
|
|
|
|
|
|
|
|
|
always:
|
|
|
|
|
- name: execute - remove the user for test
|
|
|
|
|
|