July 2017
Intermediate to advanced
402 pages
9h 38m
English
We are now going to create a crontab entry to periodically call ansible-pull. Here too, we will rely on Ansible to create our cronjob remotely. Run the following command, adapting the IP address:
$ ansible '54.175.86.38' \
--private-key ~/.ssh/EffectiveDevOpsAWS.pem \
-m cron -a 'name=ansible-pull minute="*/10" job="/usr/local/bin/ansible-pull -U https://github.com/<your_username>/ansible helloworld.yml -i localhost --sleep 60"'
In the preceding command, we are telling Ansible to use the cron module targeting our ec2 instance. We are providing a name that Ansible will use to track the cronjob over time, telling cron to run the job every 10 minutes, and finally the command to execute and its parameters. ...
Read now
Unlock full access