mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
add test for template, file, and copy with hardlinks
This commit is contained in:
committed by
Toshio Kuratomi
parent
ecfa7f696d
commit
2b14fdbce3
@@ -306,6 +306,46 @@
|
||||
that:
|
||||
- "template_result|changed"
|
||||
|
||||
## demonstrate copy module failing to overwrite a file that's been hard linked
|
||||
## https://github.com/ansible/ansible/issues/10834
|
||||
|
||||
- name: ensure test dir is absent
|
||||
file:
|
||||
path: /tmp/10834.2_test
|
||||
state: absent
|
||||
|
||||
- name: create test dir
|
||||
file:
|
||||
path: /tmp/10834.2_test
|
||||
state: directory
|
||||
|
||||
- name: template out test file to system 1
|
||||
template:
|
||||
src: foo.j2
|
||||
dest: /tmp/10834.2_test/test_file
|
||||
|
||||
# not an issue when not hard linked
|
||||
- name: template out test file to system 2
|
||||
template:
|
||||
src: foo.j2
|
||||
dest: /tmp/10834.2_test/test_file
|
||||
|
||||
- name: make hard link
|
||||
file:
|
||||
src: /tmp/10834.2_test/test_file
|
||||
dest: /tmp/10834.2_test/test_file_hardlink
|
||||
state: hard
|
||||
|
||||
- name: template out test file to system 3
|
||||
template:
|
||||
src: foo.j2
|
||||
dest: /tmp/10834.2_test/test_file
|
||||
|
||||
- name: cleanup
|
||||
file:
|
||||
path: /tmp/10834.2_test
|
||||
state: absent
|
||||
|
||||
- name: change var for the template
|
||||
set_fact:
|
||||
templated_var: "templated_var_loaded"
|
||||
|
||||
Reference in New Issue
Block a user