SlideShare a Scribd company logo
1 of 22
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.
2
3
Contents
1. Introduction
1. me
2. iWelcome
3. Why testing
2. Molecule v1
3. Molecule v2
4. Walkthrough
4
Introduction
- name: Werner Dijkerman
work:
title: System Engineer (Engineering)
employer: iWelcome
contact:
- @djwasabiman
- www.werner-dijkerman.nl
other:
technical_reviewer:
- Zabbix Network Monitoring 2nd (Packt Pub, book)
- Learning Docker 2nd (Packt Pub, book)
- Advanced IT Automation with Ansible 2 (Packt Pub, Video)
cats: True
5
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
6
Selection of blue chip customers using iWelcome IDaaS for Workforce and / or CIAM use cases
7
Introduction
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?
• etc
8
Introduction
What do we get for testing roles:
Improving reliability:
• We get more confidence and see that it works
• Run the tests when Pull Requests are created
Better quality:
• Add functionality and/or tests
9
Molecule v1
“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
https://github.com/metacloud/molecule
https://molecule.readthedocs.io/
10
Molecule v1
Drivers:
• Vagrant (Default)
• OpenStack
• Docker
New Ansible role:
molecule init --driver docker --role <role_name>
When you already have a role:
molecule init --driver docker
https://molecule.readthedocs.io/en/stable-1.24/driver/index.html
11
Molecule v1
o Providers (Specific to driver: Vagrant)
• Virtualbox (Default)
• Libvrt
• Parallels
• VMware Fusion
https://molecule.readthedocs.io/en/stable-1.24/provider/
index.html
12
Molecule v1
o Verifiers
Used for the validation/testing of the role.
• TestInfra (Default)
• ServerSpec
• Goss
https://molecule.readthedocs.io/en/stable-1.24/verifier.html
13
Molecule v1
o Molecule subcommands
• molecule login ( --host <instance_name> )
• molecule syntax
• molecule create
• molecule converge
• molecule idempotence
• molecule verify
• ansible-lint
• flake
• Testinfra / Serverspec / Goss
• molecule destroy
All can be done with the subcommand: molecule test
14
Molecule v1
Ansible role dependencies
Ansible configuration
Molecule configuration
Docker driver
Verifier configuration
molecule.yml
15
Molecule v2
Molecule v2
• Ansible lint has own sub command
• Docker (Default driver)
• Using Scenarios!
http://molecule.readthedocs.io/en/v2/
16
Molecule v2
http://molecule.readthedocs.io/en/v2/configuration.html#scenario
17
Walkthrough
Using SystemD
https://github.com/dj-wasabi/ansible-zabbix-agent/blob/master/
molecule.yml#L26
18
Walkthrough
Using group_vars
https://github.com/dj-wasabi/ansible-zabbix-server/blob/
master/molecule.yml#L16
19
Walkthrough
Multiple instances like running a cluster
molecule.yml playbook.yml
20
Walkthrough
Execution of role depends on other service
https://github.com/dj-wasabi/ansible-ossec-agent/blob/
master/playbook.yml
21
Walkthrough
TestInfra check per distribution
https://github.com/dj-wasabi/ansible-zabbix-server/blob/
master/tests/test_default.py#L63
Thank you for your attention!

More Related Content

What's hot

Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with AnsibleMartin Etmajer
 
Master slave pattern
Master slave patternMaster slave pattern
Master slave patternHeo Seungwook
 
Présentation Maven
Présentation MavenPrésentation Maven
Présentation MavenSOAT
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Ryan Jarvinen
 
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...XavierPestel
 
DevOps with Azure, Kubernetes, and Helm Webinar
DevOps with Azure, Kubernetes, and Helm WebinarDevOps with Azure, Kubernetes, and Helm Webinar
DevOps with Azure, Kubernetes, and Helm WebinarCodefresh
 
Jenkins Introduction
Jenkins IntroductionJenkins Introduction
Jenkins IntroductionPavan Gupta
 
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20Amazon Web Services Korea
 
Jenkins를 활용한 Openshift CI/CD 구성
Jenkins를 활용한 Openshift CI/CD 구성 Jenkins를 활용한 Openshift CI/CD 구성
Jenkins를 활용한 Openshift CI/CD 구성 rockplace
 
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017Amazon Web Services Korea
 
Jenkins tutorial for beginners
Jenkins tutorial for beginnersJenkins tutorial for beginners
Jenkins tutorial for beginnersBugRaptors
 
A la découverte de kubernetes
A la découverte de kubernetesA la découverte de kubernetes
A la découverte de kubernetesJulien Maitrehenry
 
왜 컨테이너인가? - OpenShift 구축 사례와 컨테이너로 환경 전환 시 고려사항
왜 컨테이너인가? - OpenShift 구축 사례와 컨테이너로 환경 전환 시 고려사항왜 컨테이너인가? - OpenShift 구축 사례와 컨테이너로 환경 전환 시 고려사항
왜 컨테이너인가? - OpenShift 구축 사례와 컨테이너로 환경 전환 시 고려사항rockplace
 
今Serverlessが面白いわけ
今Serverlessが面白いわけ今Serverlessが面白いわけ
今Serverlessが面白いわけYoichi Kawasaki
 

What's hot (20)

kubernetes, pourquoi et comment
kubernetes, pourquoi et commentkubernetes, pourquoi et comment
kubernetes, pourquoi et comment
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with Ansible
 
Master slave pattern
Master slave patternMaster slave pattern
Master slave pattern
 
Jenkins
JenkinsJenkins
Jenkins
 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
 
Présentation Maven
Présentation MavenPrésentation Maven
Présentation Maven
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
DevOps with Kubernetes
DevOps with KubernetesDevOps with Kubernetes
DevOps with Kubernetes
 
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
 
DevOps with Azure, Kubernetes, and Helm Webinar
DevOps with Azure, Kubernetes, and Helm WebinarDevOps with Azure, Kubernetes, and Helm Webinar
DevOps with Azure, Kubernetes, and Helm Webinar
 
Jenkins Introduction
Jenkins IntroductionJenkins Introduction
Jenkins Introduction
 
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
AWS 기반의 마이크로 서비스 아키텍쳐 구현 방안 :: 김필중 :: AWS Summit Seoul 20
 
Hands-on Helm
Hands-on Helm Hands-on Helm
Hands-on Helm
 
ansible why ?
ansible why ?ansible why ?
ansible why ?
 
Jenkins를 활용한 Openshift CI/CD 구성
Jenkins를 활용한 Openshift CI/CD 구성 Jenkins를 활용한 Openshift CI/CD 구성
Jenkins를 활용한 Openshift CI/CD 구성
 
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
마이크로서비스를 위한 AWS 아키텍처 패턴 및 모범 사례 - AWS Summit Seoul 2017
 
Jenkins tutorial for beginners
Jenkins tutorial for beginnersJenkins tutorial for beginners
Jenkins tutorial for beginners
 
A la découverte de kubernetes
A la découverte de kubernetesA la découverte de kubernetes
A la découverte de kubernetes
 
왜 컨테이너인가? - OpenShift 구축 사례와 컨테이너로 환경 전환 시 고려사항
왜 컨테이너인가? - OpenShift 구축 사례와 컨테이너로 환경 전환 시 고려사항왜 컨테이너인가? - OpenShift 구축 사례와 컨테이너로 환경 전환 시 고려사항
왜 컨테이너인가? - OpenShift 구축 사례와 컨테이너로 환경 전환 시 고려사항
 
今Serverlessが面白いわけ
今Serverlessが面白いわけ今Serverlessが面白いわけ
今Serverlessが面白いわけ
 

Similar to Testing ansible roles with molecule

Creating Realistic Unit Tests with Testcontainers
Creating Realistic Unit Tests with TestcontainersCreating Realistic Unit Tests with Testcontainers
Creating Realistic Unit Tests with TestcontainersPaul Balogh
 
Lessons Learned: Continuous Deployment For Docker (presented at Cloud Expo We...
Lessons Learned: Continuous Deployment For Docker (presented at Cloud Expo We...Lessons Learned: Continuous Deployment For Docker (presented at Cloud Expo We...
Lessons Learned: Continuous Deployment For Docker (presented at Cloud Expo We...Stefana Muller
 
Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsSOASTA
 
Mastering DevOps with Oracle
Mastering DevOps with Oracle Mastering DevOps with Oracle
Mastering DevOps with Oracle jeckels
 
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse FoundationOMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse FoundationOpen Mobile Alliance
 
Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18Mary Joy Sabal
 
CHAI by Wanclouds for OpenStack Operations
CHAI by Wanclouds for OpenStack OperationsCHAI by Wanclouds for OpenStack Operations
CHAI by Wanclouds for OpenStack OperationsZayad Bin Tariq Malik
 
Práticas, Técnicas e Ferramentas para Continuous Delivery com ALM
Práticas, Técnicas e Ferramentas para Continuous Delivery com ALMPráticas, Técnicas e Ferramentas para Continuous Delivery com ALM
Práticas, Técnicas e Ferramentas para Continuous Delivery com ALMMarcelo Sousa Ancelmo
 
Introduction to CloudHub 2.0
Introduction to CloudHub 2.0Introduction to CloudHub 2.0
Introduction to CloudHub 2.0NeerajKumar1965
 
Loopt unit test experiences
Loopt unit test experiencesLoopt unit test experiences
Loopt unit test experiencesHeine Frifeldt
 
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemMelhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemBruno Borges
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
Devcon3 : iExec Allowing Scalable, Efficient, and Virtualized Off-chain Execu...
Devcon3 : iExec Allowing Scalable, Efficient, and Virtualized Off-chain Execu...Devcon3 : iExec Allowing Scalable, Efficient, and Virtualized Off-chain Execu...
Devcon3 : iExec Allowing Scalable, Efficient, and Virtualized Off-chain Execu...Gilles Fedak
 
Mihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate EverythingMihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate EverythingMihai Criveti
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build PipelineSamuel Brown
 
Monitoring Oracle Databases with Opsview
Monitoring Oracle Databases with OpsviewMonitoring Oracle Databases with Opsview
Monitoring Oracle Databases with OpsviewOpsview
 
From Sage 500 to 1000 ... Performance Testing myths exposed
From Sage 500 to 1000 ... Performance Testing myths exposedFrom Sage 500 to 1000 ... Performance Testing myths exposed
From Sage 500 to 1000 ... Performance Testing myths exposedTrust IV Ltd
 
Oracle_ebs_12.2_Admin_guide_for_dba.pptx
Oracle_ebs_12.2_Admin_guide_for_dba.pptxOracle_ebs_12.2_Admin_guide_for_dba.pptx
Oracle_ebs_12.2_Admin_guide_for_dba.pptxAbdallahAttia9
 

Similar to Testing ansible roles with molecule (20)

Creating Realistic Unit Tests with Testcontainers
Creating Realistic Unit Tests with TestcontainersCreating Realistic Unit Tests with Testcontainers
Creating Realistic Unit Tests with Testcontainers
 
Lessons Learned: Continuous Deployment For Docker (presented at Cloud Expo We...
Lessons Learned: Continuous Deployment For Docker (presented at Cloud Expo We...Lessons Learned: Continuous Deployment For Docker (presented at Cloud Expo We...
Lessons Learned: Continuous Deployment For Docker (presented at Cloud Expo We...
 
Em13c features- HotSos 2016
Em13c features- HotSos 2016Em13c features- HotSos 2016
Em13c features- HotSos 2016
 
Continuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and JenkinsContinuous Load Testing with CloudTest and Jenkins
Continuous Load Testing with CloudTest and Jenkins
 
Mastering DevOps with Oracle
Mastering DevOps with Oracle Mastering DevOps with Oracle
Mastering DevOps with Oracle
 
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse FoundationOMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
 
Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18
 
CHAI by Wanclouds for OpenStack Operations
CHAI by Wanclouds for OpenStack OperationsCHAI by Wanclouds for OpenStack Operations
CHAI by Wanclouds for OpenStack Operations
 
Práticas, Técnicas e Ferramentas para Continuous Delivery com ALM
Práticas, Técnicas e Ferramentas para Continuous Delivery com ALMPráticas, Técnicas e Ferramentas para Continuous Delivery com ALM
Práticas, Técnicas e Ferramentas para Continuous Delivery com ALM
 
Introduction to CloudHub 2.0
Introduction to CloudHub 2.0Introduction to CloudHub 2.0
Introduction to CloudHub 2.0
 
Loopt unit test experiences
Loopt unit test experiencesLoopt unit test experiences
Loopt unit test experiences
 
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemMelhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na Nuvem
 
Em13c New Features- One of Two
Em13c New Features- One of TwoEm13c New Features- One of Two
Em13c New Features- One of Two
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
Devcon3 : iExec Allowing Scalable, Efficient, and Virtualized Off-chain Execu...
Devcon3 : iExec Allowing Scalable, Efficient, and Virtualized Off-chain Execu...Devcon3 : iExec Allowing Scalable, Efficient, and Virtualized Off-chain Execu...
Devcon3 : iExec Allowing Scalable, Efficient, and Virtualized Off-chain Execu...
 
Mihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate EverythingMihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate Everything
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build Pipeline
 
Monitoring Oracle Databases with Opsview
Monitoring Oracle Databases with OpsviewMonitoring Oracle Databases with Opsview
Monitoring Oracle Databases with Opsview
 
From Sage 500 to 1000 ... Performance Testing myths exposed
From Sage 500 to 1000 ... Performance Testing myths exposedFrom Sage 500 to 1000 ... Performance Testing myths exposed
From Sage 500 to 1000 ... Performance Testing myths exposed
 
Oracle_ebs_12.2_Admin_guide_for_dba.pptx
Oracle_ebs_12.2_Admin_guide_for_dba.pptxOracle_ebs_12.2_Admin_guide_for_dba.pptx
Oracle_ebs_12.2_Admin_guide_for_dba.pptx
 

Recently uploaded

AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsThierry TROUIN ☁
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Roomdivyansh0kumar0
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
Gram Darshan PPT cyber rural in villages of india
Gram Darshan PPT cyber rural  in villages of indiaGram Darshan PPT cyber rural  in villages of india
Gram Darshan PPT cyber rural in villages of indiaimessage0108
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...aditipandeya
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Roomgirls4nights
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsstephieert
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 

Recently uploaded (20)

AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with Flows
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Gram Darshan PPT cyber rural in villages of india
Gram Darshan PPT cyber rural  in villages of indiaGram Darshan PPT cyber rural  in villages of india
Gram Darshan PPT cyber rural in villages of india
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girls
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 

Testing ansible roles with molecule

  • 1. Testing Ansible roles with Molecule Werner Dijkerman, Nieuwegein, 17-05-2017
  • 2. 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. 2
  • 3. 3 Contents 1. Introduction 1. me 2. iWelcome 3. Why testing 2. Molecule v1 3. Molecule v2 4. Walkthrough
  • 4. 4 Introduction - name: Werner Dijkerman work: title: System Engineer (Engineering) employer: iWelcome contact: - @djwasabiman - www.werner-dijkerman.nl other: technical_reviewer: - Zabbix Network Monitoring 2nd (Packt Pub, book) - Learning Docker 2nd (Packt Pub, book) - Advanced IT Automation with Ansible 2 (Packt Pub, Video) cats: True
  • 5. 5 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
  • 6. 6 Selection of blue chip customers using iWelcome IDaaS for Workforce and / or CIAM use cases
  • 7. 7 Introduction 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? • etc
  • 8. 8 Introduction What do we get for testing roles: Improving reliability: • We get more confidence and see that it works • Run the tests when Pull Requests are created Better quality: • Add functionality and/or tests
  • 9. 9 Molecule v1 “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 https://github.com/metacloud/molecule https://molecule.readthedocs.io/
  • 10. 10 Molecule v1 Drivers: • Vagrant (Default) • OpenStack • Docker New Ansible role: molecule init --driver docker --role <role_name> When you already have a role: molecule init --driver docker https://molecule.readthedocs.io/en/stable-1.24/driver/index.html
  • 11. 11 Molecule v1 o Providers (Specific to driver: Vagrant) • Virtualbox (Default) • Libvrt • Parallels • VMware Fusion https://molecule.readthedocs.io/en/stable-1.24/provider/ index.html
  • 12. 12 Molecule v1 o Verifiers Used for the validation/testing of the role. • TestInfra (Default) • ServerSpec • Goss https://molecule.readthedocs.io/en/stable-1.24/verifier.html
  • 13. 13 Molecule v1 o Molecule subcommands • molecule login ( --host <instance_name> ) • molecule syntax • molecule create • molecule converge • molecule idempotence • molecule verify • ansible-lint • flake • Testinfra / Serverspec / Goss • molecule destroy All can be done with the subcommand: molecule test
  • 14. 14 Molecule v1 Ansible role dependencies Ansible configuration Molecule configuration Docker driver Verifier configuration molecule.yml
  • 15. 15 Molecule v2 Molecule v2 • Ansible lint has own sub command • Docker (Default driver) • Using Scenarios! http://molecule.readthedocs.io/en/v2/
  • 19. 19 Walkthrough Multiple instances like running a cluster molecule.yml playbook.yml
  • 20. 20 Walkthrough Execution of role depends on other service https://github.com/dj-wasabi/ansible-ossec-agent/blob/ master/playbook.yml
  • 21. 21 Walkthrough TestInfra check per distribution https://github.com/dj-wasabi/ansible-zabbix-server/blob/ master/tests/test_default.py#L63
  • 22. Thank you for your attention!