So Ansible's happier in push mode, however, there are already some options, and you don't even need the cron approach above.
Look into "ansible-pull" which is suitable for wakeup on a crontab and will fetch down the latest of a playbook run. (Also of interest -- callbacks in Ansible Tower -- which can be requested by cron via simple wget, and ask the server to push down it's latest content. This can be a great way to manage a fleet of image based cloud deployments that just need a refresh, or otherwise ephmeral or autoscaling systems -- but might not be for you) In any case, assume you were using Ansible pull, use the --only-if-changed flag, and if the remote repo hasn't changed, it won't have any work to do. Have it simply wakeup every 5 minutes and apply changes -- no listening and no server would be required. Now, one thought is ansible-pull probably use a check to see if it's already running, to make that a bit easier -- that's one thing it currently doesn't do. But yeah, we love that we don't have any daemons and don't need a standing server infrastructure -- it's more secure, there are less moving parts, and we'd like to keep it that way :) On Wed, Mar 5, 2014 at 5:10 PM, Erik Anderson <[email protected]> wrote: > On Wed, Mar 5, 2014 at 4:06 PM, Arie Skliarouk <[email protected]> wrote: > >> The idea is for ansible to start a playbook immediately once >> configuration changes. Bonus for choosing correct playbook across several >> available (presumably by calculating the playbook affected by the changed >> variable). Same for changed playbook. > > > If you're on linux, you could use Incron[1] for this. Incron uses the > kernel's inotify system to trigger cron-style jobs, triggered on filesystem > events. > > In your case, incron could be configured to run an ansible-playbook > command whenever your config files or playbooks change. > > -erik > [1] http://inotify.aiken.cz/?section=incron&page=about&lang=en > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/CADdM08p%3DCXMO%2B9Hr%3Dw_o-pw6ia9LQSrp%2Bp71VKMU_wzXqaVaiQ%40mail.gmail.com<https://groups.google.com/d/msgid/ansible-project/CADdM08p%3DCXMO%2B9Hr%3Dw_o-pw6ia9LQSrp%2Bp71VKMU_wzXqaVaiQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/groups/opt_out. > -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAEVJ8QNy%2Bk-cbediwr3Xbvx9HoWHUiwJwktxhq9KUJbUymsyoQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
