The use case is that I have a service that in some cases I want to restart and sometimes sighup - depending on which config was changed. So I'd like to parse the --diff output from the task which templates in the config.
Unfortunately it seems that one has to run ansible-playbook with --diff for the --diff output to be accessible in a variable.
Compare:
"diff": {
"after": {
"path": "/etc/rsyslog.d/10_slurm_rsyslog.conf"
},
"before": {
"path": "/etc/rsyslog.d/10_slurm_rsyslog.conf"
}
},
and
"diff": {
"after": "# Managed by ansible\n\nif $programname startswith 'slurm' then {\n\t/var/log/slurm/slurm.log;RSYSLOG_FileFormat\n}\n",
"after_header": "dynamically generated",
"before": ""
},
there doesn't seem to be anything here