We use ansible for our day to day operation and so far so good. We have been looking for a way to run local test etc just like chef guys and found molecule that we use with testinfra/vagrant. While I personally found it great for developing roles, I am looking for a way to actually test the playbook(which uses multiple roles , some with pre and post tasks) itself in PRODUCTION after it runs.
EDITS : Say the playbook configures 5 boxes; creates some mongodb replica set (3 boxes) and deploys some java applications (2 boxes). Basic check after this runs would be to find out if Mongodb members can reach each other, or whether the app boxes can connect and other more specific checks.
Ideally I could use testinfra without the molecule part and I have not really found a way of doing that by also loading the ansible variable file etc.
I have looked into ansible_spec which from my understanding is from serverspec.
Probably my perception of these tools are wrong but, I am thinking of having the check to be say: the last task in the playbook or call it inside the post_tasks stage. Not sure how all these will pan out but I would be grateful if you could share your wisdom with me.
Thanks in advance