mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Show diff when file: state=link changes the symlink target (#22243)
* Show diff when file: state=link changes the symlink target * Integration test for symlink target change * Also check soft link idempotency
This commit is contained in:
parent
228131d1cd
commit
15c7288ab9
2 changed files with 22 additions and 0 deletions
|
@ -97,6 +97,26 @@
|
|||
that:
|
||||
- "file5_result.changed == true"
|
||||
|
||||
- name: change soft link to relative
|
||||
file: src={{output_file|basename}} dest={{output_dir}}/soft.txt state=link
|
||||
register: file5a_result
|
||||
|
||||
- name: verify that the file was marked as changed
|
||||
assert:
|
||||
that:
|
||||
- "file5a_result.changed == true"
|
||||
- "file5a_result.diff.before.src == output_file|expanduser"
|
||||
- "file5a_result.diff.after.src == output_file|basename"
|
||||
|
||||
- name: soft link idempotency check
|
||||
file: src={{output_file|basename}} dest={{output_dir}}/soft.txt state=link
|
||||
register: file5b_result
|
||||
|
||||
- name: verify that the file was not marked as changed
|
||||
assert:
|
||||
that:
|
||||
- "file5b_result.changed == false"
|
||||
|
||||
- name: create hard link to file
|
||||
file: src={{output_file}} dest={{output_dir}}/hard.txt state=hard
|
||||
register: file6_result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue