Dear Ansible Community,
We are trying to migrate from one old system to Ansible. With old system, we are able to daemonize shell strings like this: exec -a clic /bin/sh -c “while :; do mkdir -p /local/clicop ; rsync -b --copy-links --timeout=5 -p /clic/clicbin /local/clicop/clic; ./clic; sleep 10; done”
With Ansible, I found only one way to do this:
name: execute diamon client
action: shell chdir=/local/diamonop /bin/sh -c “(while :; do mkdir -p /local/clicop; rsync -b --copy-links --timeout=5 -p /clic/clicbin /local/clicop/clic; ./clic; sleep 10; done;) >& /dev/null &”
async: 10
poll: 0
Is there any more elegant solution? Or it’s better to think about separate ansible module or setting like damonize: yes?
Thank you in advance and have a good day!