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

MicroServices with Containers, Kubernetes & ServiceMesh
MicroServices with Containers, Kubernetes & ServiceMeshMicroServices with Containers, Kubernetes & ServiceMesh
MicroServices with Containers, Kubernetes & ServiceMeshAkash Agrawal
 
CI/CD with Openshift and Jenkins
CI/CD with Openshift and JenkinsCI/CD with Openshift and Jenkins
CI/CD with Openshift and JenkinsAri LiVigni
 
Breaking Observability Chaos: Best Practices to Monitor AWS Cloud Native Apps...
Breaking Observability Chaos: Best Practices to Monitor AWS Cloud Native Apps...Breaking Observability Chaos: Best Practices to Monitor AWS Cloud Native Apps...
Breaking Observability Chaos: Best Practices to Monitor AWS Cloud Native Apps...Amazon Web Services
 
Enterprise Application Integration Technologies
Enterprise Application Integration TechnologiesEnterprise Application Integration Technologies
Enterprise Application Integration TechnologiesPeter R. Egli
 
Introduction To Terraform
Introduction To TerraformIntroduction To Terraform
Introduction To TerraformSasitha Iresh
 
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...Yevgeniy Brikman
 
Everything you want to know about microservices
Everything you want to know about microservicesEverything you want to know about microservices
Everything you want to know about microservicesYouness Lasmak
 
OpenShift-Technical-Overview.pdf
OpenShift-Technical-Overview.pdfOpenShift-Technical-Overview.pdf
OpenShift-Technical-Overview.pdfJuanSalinas593459
 
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...Janusz Nowak
 
DevOps 101 - an Introduction to DevOps
DevOps 101  - an Introduction to DevOpsDevOps 101  - an Introduction to DevOps
DevOps 101 - an Introduction to DevOpsRed Gate Software
 
Showdown: Integration Framework (Spring Integration, Apache Camel) vs. Enterp...
Showdown: Integration Framework (Spring Integration, Apache Camel) vs. Enterp...Showdown: Integration Framework (Spring Integration, Apache Camel) vs. Enterp...
Showdown: Integration Framework (Spring Integration, Apache Camel) vs. Enterp...Kai Wähner
 
GitOps is IaC done right
GitOps is IaC done rightGitOps is IaC done right
GitOps is IaC done rightChen Cheng-Wei
 
Introduction to GCP (Google Cloud Platform)
Introduction to GCP (Google Cloud Platform)Introduction to GCP (Google Cloud Platform)
Introduction to GCP (Google Cloud Platform)Pulkit Gupta
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineAnatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineRobert McDermott
 
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Kai Wähner
 
Tanzu Mission Control における Open Policy Agent (OPA) の利用
Tanzu Mission Control における Open Policy Agent (OPA) の利用Tanzu Mission Control における Open Policy Agent (OPA) の利用
Tanzu Mission Control における Open Policy Agent (OPA) の利用Motonori Shindo
 

What's hot (20)

MicroServices with Containers, Kubernetes & ServiceMesh
MicroServices with Containers, Kubernetes & ServiceMeshMicroServices with Containers, Kubernetes & ServiceMesh
MicroServices with Containers, Kubernetes & ServiceMesh
 
DevOps: Infrastructure as Code
DevOps: Infrastructure as CodeDevOps: Infrastructure as Code
DevOps: Infrastructure as Code
 
CI/CD with Openshift and Jenkins
CI/CD with Openshift and JenkinsCI/CD with Openshift and Jenkins
CI/CD with Openshift and Jenkins
 
Breaking Observability Chaos: Best Practices to Monitor AWS Cloud Native Apps...
Breaking Observability Chaos: Best Practices to Monitor AWS Cloud Native Apps...Breaking Observability Chaos: Best Practices to Monitor AWS Cloud Native Apps...
Breaking Observability Chaos: Best Practices to Monitor AWS Cloud Native Apps...
 
Enterprise Application Integration Technologies
Enterprise Application Integration TechnologiesEnterprise Application Integration Technologies
Enterprise Application Integration Technologies
 
Introduction To Terraform
Introduction To TerraformIntroduction To Terraform
Introduction To Terraform
 
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
 
Everything you want to know about microservices
Everything you want to know about microservicesEverything you want to know about microservices
Everything you want to know about microservices
 
OpenShift-Technical-Overview.pdf
OpenShift-Technical-Overview.pdfOpenShift-Technical-Overview.pdf
OpenShift-Technical-Overview.pdf
 
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
 
DevOps 101 - an Introduction to DevOps
DevOps 101  - an Introduction to DevOpsDevOps 101  - an Introduction to DevOps
DevOps 101 - an Introduction to DevOps
 
Showdown: Integration Framework (Spring Integration, Apache Camel) vs. Enterp...
Showdown: Integration Framework (Spring Integration, Apache Camel) vs. Enterp...Showdown: Integration Framework (Spring Integration, Apache Camel) vs. Enterp...
Showdown: Integration Framework (Spring Integration, Apache Camel) vs. Enterp...
 
GitOps is IaC done right
GitOps is IaC done rightGitOps is IaC done right
GitOps is IaC done right
 
Introduction to GCP (Google Cloud Platform)
Introduction to GCP (Google Cloud Platform)Introduction to GCP (Google Cloud Platform)
Introduction to GCP (Google Cloud Platform)
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineAnatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
 
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
 
Database CI/CD Pipeline
Database CI/CD PipelineDatabase CI/CD Pipeline
Database CI/CD Pipeline
 
Tanzu Mission Control における Open Policy Agent (OPA) の利用
Tanzu Mission Control における Open Policy Agent (OPA) の利用Tanzu Mission Control における Open Policy Agent (OPA) の利用
Tanzu Mission Control における Open Policy Agent (OPA) の利用
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
Agile transformation in a large financial institution
Agile transformation in a large financial institutionAgile transformation in a large financial institution
Agile transformation in a large financial institution
 

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

VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service PuneVIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service PuneCall girls in Ahmedabad High profile
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
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
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
Denver Web Design brochure for public viewing
Denver Web Design brochure for public viewingDenver Web Design brochure for public viewing
Denver Web Design brochure for public viewingbigorange77
 
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
 
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
 
象限策略:Google Workspace 与 Microsoft 365 对业务的影响 .pdf
象限策略:Google Workspace 与 Microsoft 365 对业务的影响 .pdf象限策略:Google Workspace 与 Microsoft 365 对业务的影响 .pdf
象限策略:Google Workspace 与 Microsoft 365 对业务的影响 .pdfkeithzhangding
 
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
 
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
 
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
 
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Deliverybabeytanya
 
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
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 

Recently uploaded (20)

VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service PuneVIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
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
 
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
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
Denver Web Design brochure for public viewing
Denver Web Design brochure for public viewingDenver Web Design brochure for public viewing
Denver Web Design brochure for public viewing
 
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
 
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
 
象限策略:Google Workspace 与 Microsoft 365 对业务的影响 .pdf
象限策略:Google Workspace 与 Microsoft 365 对业务的影响 .pdf象限策略:Google Workspace 与 Microsoft 365 对业务的影响 .pdf
象限策略:Google Workspace 与 Microsoft 365 对业务的影响 .pdf
 
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
 
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
 
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
 
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
 
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
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 

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!