Hello,
(short version)
We want to discuss adding a test parameter to playbooks
and tasks.
Verification of configuration is an important step to making sure
your systems are in the state you believe they are in.
An idea for testing would be a playbook directive to run some
test playbook, basically including the playbook after the current one.
An idea for testing tasks is a little more tricky, because sequence
matters, would be to specify a handler to run.
-vvv (very verbose version)
Something our group has discussed a few times is that Ansible
can be used to verify that your configuration is truly live on
the system.
For instance, in dealing with a new kernel update, kernel modules
such as Nvidia graphics, VMware, or VirtualBox need to be updated.
It would also be useful in most places where a conf file is templated or
copied over. Some services, like named or nagios, come with a checkconf
or pre-flight check in their command line util.
We tend to run tests at the end of the playbook, register the result,
and then send fail mail to our ticket queue so we can look into that
particular machine,
(why it failed, how to correct it ,
how to make the playbook more robust, etc…)
Part of the problem is specifying when tasks run. In some cases
it should directly after the task, sometimes it would need to be after
the handlers restarted services.
I’ll put down an example of what setting up named looks like now,
and then a couple ideas for a test option.