Five Questions: Testing Ansible Playbooks & Roles
Next up in our #AskAnsible posts is Chris Meyers, our Senior Software Engineer.
Learn his take on five key questions we often get regarding testing Ansible Playbooks and roles.
1. Why should I test my Playbooks and roles?
Chris: Ansible Playbooks and roles should be treated like production code. Production code usually has unit tests, functional tests, and integration tests.
- Unit testing Ansible is equivalent to unit testing SQL queries, you just normally don’t do it. Ansible unit testing belongs at the Python module level.
- Function testing with Ansible would require a large amount of system state setup or mocking, and it just isn't realistic.
- Integration testing is the most useful. It ensures that your intent, expressed in English, is translated correctly to Ansible’s declarative language.
- Ex: you want to set up a LAMP or MEAN stack. A simple integration test would be to issue an http request that you know exercises the database. The integration test would ensure that your setup is correct from end to end.
Chris: You can start at any time! Tests can be added for new Playbooks or to existing Playbooks. Testing Continue reading


Coco also helps a blockchain network reach 1,600 transactions per second.
The move gets AWS a seat at the table for ongoing Kubernetes development.
It’s like Slack for security teams, but with a built-in data store, graphing, threat visualization, and automation.
Christine Winston (director of partnerships, Path Forward), Me, and Tami Forman (executive director, Path Forward)
End users are willing to pay a premium for 5G's benefits.