We are now going to create a cron tab entry to periodically call ansible-pull. Here, too, we will rely on Ansible to create our cron job remotely. Run the following command by adapting the IP address:
$ ansible '18.206.223.199' \ --private-key ~/.ssh/EffectiveDevOpsAWS.pem \ -m cron -a 'name=ansible-pull minute="*/10" job="/usr/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. Here, we are providing a name that Ansible will use to track the cron job over time, telling cron to run the job every 10 minutes, followed by the command to execute and its parameters. ...