--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b11a6bc2-2938-2bdd-db40-b91ec77e7299%40parsetree.com.
This isn't really an Ansible problem per se unless it's *only* ansible in a subshell that doesn't run from cron? Have you tested basic cron functionality using something simple like this (or something even more basic):#!/bin/shz4=`date +%Y%m%d%H%M`touch /tmp/${z4}And then check to see if that file is created every 30 minutes *does* work?
First questions that spring to mind are:- is there anything in the cron log, syslog or journal for the crond service?
- is anything else running successfully out of /etc/cron.d / cron.daily etc?
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/33ab4c47-f91e-4587-a5f2-08341ecf4fa5n%40googlegroups.com.
OK, that's some useful extra info. I've just had a very quick basic play (I haven't touched cron in earnest for a long time).Have you tried echo-ing $z4 and appended to a tmp file to see if there's anything in it at run time?
I've tried a few variations in a standard user's crontab:root@DESKTOP-9HGJE25:~# crontab -u wmcdonald -l | grep -v ^#
* * * * * ansible -m setup localhost
* * * * * ~/ansible-testroot@DESKTOP-9HGJE25:~# cat /home/wmcdonald/ansible-test
#!/bin/sh
ansible -m setup localhost
BASIC_VAR=`ansible -m setup localhost`
echo $BASIC_VAR
VERBOSE_VAR=`ansible -vvv -m ping localhost`
echo $VERBOSE_VAR
FILE_OUTPUT=`ansible -m ping localhost`
echo $FILE_OUTPUT >> /tmp/ansible.outThe output from the last set of steps shows:root@DESKTOP-9HGJE25:~# cat /tmp/ansible.out
localhost | SUCCESS => { "changed": false, "ping": "pong" }
localhost | SUCCESS => { "changed": false, "ping": "pong" }I did notice from syslog that without an MTA, cron (on Ubuntu, at least) is throwing away output:/var/log/syslog:Aug 31 20:09:02 DESKTOP-9HGJE25 CRON[2361]: (CRON) info (No MTA installed, discarding output)