How to run a shell command in ansible's check mode?
In check mode, I want to display the current commit in the server. I'm using the shell command (git rev-parse HEAD) to register the variable and then print/debug it but ansible skips shell commands in check mode.
Is there anyway to mark a shell command as safe to run in check mode?
Or any ansible module to do what I want? I checked into git's module but it only looks like it does checkouts.
Any input would be appreciated.
Found the answer. You have to add always_run: True to the task.