I have a role that uses the cron module to set three cron tasks. When I run ansible-playbook for this role, the first task will fail, but on the 2nd run, it will pass an the 2nd one will fail, on a subsequent run, the 1st and 2nd cron tasks will run, but the 3rd will fail. Running it again, all cron taks succeed and the play continues. Weird.
I am running ansible 1.2.2 on Ubuntu 13.04 x64
The relevant tasks (with some context) are:
- name: copy aur binary to node
copy: src=$item
dest=/home/a/
owner=ais group=ais mode=755
with_first_found:- templates/config/$inventory_hostname/config/aur
- templates/ar/config/aur
- name: setup minutely cron
sudo: yes
cron: name=“Minutely Tasks”
cron_file=“ar”
user=“root”
job=“cd /home/sq/ar && run-parts --report /home/sq/ar/config/cron_scripts/cron.minutely > /home/sq/ar/logs/cron.minutely”- name: setup hourly cron
sudo: yes
cron: name=“Hourly Tasks”
cron_file=“ar”
user=“sq”
minute=1
job=“cd /home/sq/ar && run-parts --report /home/sq/ar/config/cron_scripts/cron.hourly > /home/sq/ar/logs/cron.hourly”- name: setup daily cron
sudo: yes
cron: name=“Daily Tasks”
cron_file=“ar”
minute=5
hour=1
user=“sq”
job=“cd /home/sq/ar && run-parts --report /home/sq/ar/config/cron_scripts/cron.daily > /home/sq/ar/logs/cron.daily”- name: import the python path in the crontab files
lineinfile: dest=/etc/cron.d/ar
insertbefore=BOF
regexp=^PYTHONPATH=
line=PYTHONPATH=$PYTHONPATH:/home/sq/ar/config:/home/sq/ar/config/shared
And the output near the failure is: