Choose your path¶
Molecule tests Ansible roles, playbooks, and collections. Choose the guide for the kind of Ansible content you are developing. The directory layout alone does not determine the right path.
Start here¶
| If your primary goal is to... | Start with... | Typical starting shape |
|---|---|---|
| Develop and verify one reusable role | Test a role | A role directory with tasks/, defaults/, handlers/, templates/, files/, and meta/ |
| Develop and verify one or more playbooks | Test a playbook project | An ansible-creator playbook project with root playbooks, inventory, and project configuration |
| Develop, package, publish, and test a collection | Test a collection | A collection with galaxy.yml and roles, plugins, modules, or other content |
Test a role¶
Choose this path when the main question is whether a role produces the expected result. The role can be standalone or a role in the adjacent collection generated inside an ansible-creator playbook project. Start with the role testing concepts when you are focused on the role's tasks, defaults, handlers, templates, variables, and resulting state.
Test a playbook project¶
Choose this path when the main question is whether a project’s playbooks work with its inventory and project configuration. The project generated by ansible-creator init playbook includes an adjacent collection with a role. That collection is part of the playbook project scaffold and does not automatically make this a collection testing project.
Start with Test a playbook project when the scenario invokes root playbooks such as site.yml or linux_playbook.yml.
Test a collection¶
Choose this path when the primary content under development is an Ansible collection. This includes collection metadata, packaging, publishing, collection dependencies, or testing several Ansible content types together, such as collection roles, plugins and playbooks.
Do not choose this path only because a playbook project contains an adjacent collection. Use Test a playbook project when the adjacent collection and its role are being used as part of the project’s root playbooks.