summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorSloane Hertel <19572925+s-hertel@users.noreply.github.com>2023-09-22 15:53:24 +0200
committerGitHub <noreply@github.com>2023-09-22 15:53:24 +0200
commit85adaa76f128b18db07c1385e23e93220dadcc5e (patch)
tree67f1fc7dd5f0346846a416650e03158f41e40643 /test/integration
parentDaemonize follow-up fixes (#81584) (diff)
downloadansible-85adaa76f128b18db07c1385e23e93220dadcc5e.tar.xz
ansible-85adaa76f128b18db07c1385e23e93220dadcc5e.zip
Add integration test for copy with force=false when dest exists (#81756)
ci_complete ci_coverage
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/targets/copy/tasks/tests.yml12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/integration/targets/copy/tasks/tests.yml b/test/integration/targets/copy/tasks/tests.yml
index b808ce4f8e..c2b8482353 100644
--- a/test/integration/targets/copy/tasks/tests.yml
+++ b/test/integration/targets/copy/tasks/tests.yml
@@ -92,6 +92,18 @@
- "stat_results.stat.issock == false"
- "stat_results.stat.checksum == ('foo.txt\n'|hash('sha1'))"
+- name: Test copying content with force=false when the dest already exists
+ copy:
+ content: other_data
+ dest: "{{ remote_file }}"
+ mode: 0444
+ force: False
+ register: repeat_copy_result
+
+- name: Assert no changes are made
+ assert:
+ that: repeat_copy_result is not changed
+
- name: Overwrite the file via same means
copy:
src: foo.txt