Testing Ansible roles with Molecule
Werner Dijkerman, Nieuwegein, 17-05-2017
Confidential and Business Information
The information contained herein is confidential information regarding the business of iWelcome BV and
may include confidential information regarding its associated entities and other 3rd
Parties. By accepting
this document and the information provided therein, the recipient agrees that it will, cause its directors,
officers, employees and representatives to, use such information discrete and exclusively for the purpose
it is intended to be used for. None of the information may be divulged to any other party or
reproduced, in whole or in part, without the express prior written permission of iWelcome. iWelcome is a
registered trademark of iWelcome BV.
Identity & Access Management (‘IAM’):
The ICT infrastructure required to provide &
manage the right access for the right people, at
the right place, on the right device to the right IT-
services, and to do that in a safe, simple, cost-
efficient and controllable manner.
IDaaS: 100% delivered as a cloud service
Selection of blue chip customers using iWelcome IDaaS for Workforce and / or CIAM use cases
o Why do we test Ansible roles?
Does the role do what it needs to do:
• Is it installing the application(s)?
• Is it configuring the correct templates?
• Is the service(s) running?
What do we get for testing roles:
• We get more confidence and see that it works
• Run the tests when Pull Requests are created
• Add functionality and/or tests
“Molecule is designed to aid in the development and testing of
Ansible roles including support for multiple instances, operating
system distributions, virtualization providers and test frameworks.”
pip install molecule
• Vagrant (Default)
New Ansible role:
molecule init --driver docker --role <role_name>
When you already have a role:
molecule init --driver docker