Ansible: How to log performed changes on the Remote Server?
Ansible can show and log the performed changes (including file diffs) locally on the Control Node, e.g.
TASK [example_task : file mode] ************************************************
--- before
+++ after
@@ -1,4 +1,4 @@
{
- "mode": "0640",
+ "mode": "0600",
"path": "/tmp/foo"
}
changed: [example.com]
On the Managed Node, the invoked modules log their name and parameters, e.g.
ansible-ansible.legacy.stat[18949]: Invoked with path=/home/admin-tkolb/.gitconfig follow=False get_checksum=True checksum_algorithm=sha1 get_md5=False get_mime=True get_attributes=True`
How can the changes, e.g. file diffs and commands executed, be logged on the Managed Node?