We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Author: René Moser <@resmo> IRC: resmo
Date: 2024-10-08
I noticed an inconsistency when using --check mode with the copy (and template) module.
--check
Returns are not returned in check mode if changed=true on an update scenario. Docs for copy's returns mentions returned on: success.
changed=true
returned on: success
we have an existing file on the target, we verify with --check, changed=False returned --> returns looks as expected.
$ ansible -m copy -a 'src=dummy.txt dest=/tmp/dummy.txt' demo-web1 --check demo-web1 | SUCCESS => { "changed": false, "checksum": "0fb00cb451fba290ac6c613cdaaf0a687145c752", "dest": "/tmp/dummy.txt", "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/tmp/dummy.txt", "size": 22, "state": "file", "uid": 0 }
Then we make some changes:
$ echo "some changes" >> dummy.txt
Run again with --check, this time we have changed=true as expected but no other returns?
$ ansible -m copy -a 'src=dummy.txt dest=/tmp/dummy.txt' demo-web1 --check demo-web1 | CHANGED => { "changed": true }
I would have expected returns, because there is an existing file.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Proposal: Make copy/template modules more consistent
Author: René Moser <@resmo> IRC: resmo
Date: 2024-10-08
Motivation
I noticed an inconsistency when using
--check
mode with the copy (and template) module.Returns are not returned in check mode if
changed=true
on an update scenario.Docs for copy's returns mentions
returned on: success
.Problems
we have an existing file on the target, we verify with
--check
, changed=False returned--> returns looks as expected.
Then we make some changes:
Run again with
--check
, this time we havechanged=true
as expected but no other returns?I would have expected returns, because there is an existing file.
Solution proposal
The text was updated successfully, but these errors were encountered: