Run ansible playbook with only recent changes from repo.

Hi Team,

First of all, thanks for the great tool.

We would like to maintain our servers using ansible. But I would like to know how the following case could be handled.

Lets say I have written a playbook to build servers from scratch. Assume this playbook contains multiple tasks and so on.

After few days, I release these servers and let developers add their own softwares to the tasks/tags.

Now instead of running ansible as whole or for whole tag, I would like to trigger ansible only for the recent changes. Would that be possible ?

One possible solution that I can think of is to write a wrapper script which would parse the yml and create a temporary yml with latest changes to run ansible. Since, playbook is stored in repo, so its possible to fetch the recent changes with diff.

Any pointers please ?

-Bala

Ummm, I’m not sure why you would want to do that really.

I do have some suggestions…

Create roles, and set them up so that you can run either individual roles or sets of roles.

For example I have a common role, a role to set up zabbix clients, a role to set up some things on the TSM servers and a role to set up things on ProLiant hardware. I can run one playbook that includes them all or I can run some playbooks that run specific sets of those.

I generally prefer to run them all as that way I can make sure that nothing has changed. It takes a little bit longer, but it provides the assurance that someone hasn’t modified the configuration manually.

It sounds like you might want three main playbooks. One that runs everything, one that runs the standard configuration tasks and one that the developers can add to.

I hope that this helps,

Adam