1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Preserve changed data on file and template ops when the mode operations don't result in a change but the files

were still replaced.
This commit is contained in:
Michael DeHaan 2012-03-18 16:58:00 -04:00
parent 82bd75c1e0
commit 9837a616eb

View file

@ -434,8 +434,9 @@ class Runner(object):
results2 = self._return_from_module(conn, host, result2)
(host, ok, data2) = results2
new_changed = data2.get('changed', False)
data['changed'] = old_changed or new_changed
data.update(data2)
if old_changed or new_changed:
data['changed'] = True
return (host, ok, data)
else:
# copy failed, return orig result without going through 'file' module
@ -483,8 +484,9 @@ class Runner(object):
results2 = self._return_from_module(conn, host, result2)
(host, ok, data2) = results2
new_changed = data2.get('changed', False)
data['changed'] = old_changed or new_changed
data.update(data2)
if old_changed or new_changed:
data['changed'] = True
return (host, ok, data)
else:
# copy failed, return orig result without going through 'file' module