SlideShare a Scribd company logo
Building and Testing 
Puppet with Docker 
Carla Souza
Carla Souza 
Software engineer for Reliant 
Puppet user since 2010 
Container virtualization user since 2008
Our environment 
~15k nodes 
Redboxes 
Amazon EC2 Instances 
Virtual machines 
OpenVZ containers 
KVM
Building and Testing from Scratch a Puppet Environment with Docker - PuppetConf 2014
Code your infrastructure
Code QA
Check your syntax 
puppet parse validate 
puppet-lint 
yaml syntax checker 
erb syntax checker
Variable data type validation 
validate_absolute_path 
validate_array 
validate_augeas 
validate_bool 
validate_cmd 
validate_hash 
validate_ipv4_address 
validate_ipv6_address 
validate_re 
validate_slength 
validate_string
Smoke testing 
#tests/test.pp 
class { 'apt': } 
puppet apply --noop --modulepath=".." tests/test.pp
rspec-puppet 
https://github.com/puppetlabs/puppetlabs-apt/blob/master/spec/unit/puppet/type/apt_key_spec.rb#L75
beaker
beaker 
https://github.com/puppetlabs/puppetlabs-apt/blob/master/spec/acceptance/nodesets/default.yml
Code Review
Building and Testing from Scratch a Puppet Environment with Docker - PuppetConf 2014
No errors on the puppet run 
!= 
Correctly configured
Building and Testing from Scratch a Puppet Environment with Docker - PuppetConf 2014
Mimic the production 
environment
Image from http://wegeekgirls.files.wordpress.com/2014/04/mystique_x-men_days-of-future-past.png
Building and Testing from Scratch a Puppet Environment with Docker - PuppetConf 2014
1. Target node's hostname 
2. Use custom facts* 
3. Specify OS 
4. Thats all 
* not required
Step 2: Facts 
Write your own custom facts 
# myserver-facts.txt 
domain=reliantsecurity.com 
ipaddress=172.17.42.1 
ipaddress_docker0=172.17.42.1 
ipaddress_lo=127.0.0.1 
ipaddress_wlan0=172.16.3.218 
is_virtual=false
Step 2: Facts 
Steal facts from an existing node
Step 2: Facts 
$ mystique fetch-facts myserver 
$ mystique fetch-facts --hostname myserver --user carla myserver.company 
# myserver-facts.txt 
domain=reliantsecurity.com 
ipaddress=172.17.42.1 
ipaddress_docker0=172.17.42.1 
ipaddress_lo=127.0.0.1 
ipaddress_wlan0=172.16.3.218 
is_virtual=false 
(...)
Step 3: Specify OS 
--os ubuntu14.04 
--os debian-wheezy
# mystique run --os ubuntu14.04 --hostname myserver
# mystique run --facts /path/to/facts.txt --hostname myserver
Image from http://wegeekgirls.files.wordpress.com/2014/04/mystique_x-men_days-of-future-past.png
FROM tianon/debian:wheezy 
RUN apt-get -qq -y install puppet puppetmaster 
ONBUILD ADD puppet.tar.gz /etc/puppet/
$ ls . 
./ 
../ 
.git/ 
.gitignore 
files/ 
templates/ 
manifests/ 
modules/ 
auth.conf 
autosign.conf 
fileserver.conf 
namespaceauth.conf
FROM mystique/debian:latest 
ADD myserver-facts.txt /etc/facter/facts.d/ 
RUN puppet apply --modulepath=/etc/puppet/modules master.pp 
CMD puppet agent --no-daemonize
# mystique run --facts /path/to/facts.txt --hostname myserver 
Report for myserver 
12 resources created 
2 warnings 
0 errors
# mystique run --facts /path/to/facts.txt  
--hostname myserver  
--verbose
Building and Testing from Scratch a Puppet Environment with Docker - PuppetConf 2014
Why using the existing 
tools?
What can I do with all 
this?
Future steps 
● Mimic existing resources from nodes 
● Extend supported OS 
● Specify puppet version 
● Multiple node testing 
○ Linking containers 
● User an existing Puppet Master
Thank you! 
carlasouza@reliantsecurity.com 
https://github.com/carlasouza/mystique* 
Twitter: @carlaas 
* not yet available

More Related Content

PDF
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
PDF
Docker puppetcamp london 2013
PDF
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
PDF
Using Docker with Puppet - PuppetConf 2014
PDF
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
PDF
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
PDF
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
PDF
Fabric workshop(1) - (MOSG)
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
Docker puppetcamp london 2013
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Using Docker with Puppet - PuppetConf 2014
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
Fabric workshop(1) - (MOSG)

What's hot (20)

PDF
Instruction: dev environment
PDF
Steamlining your puppet development workflow
PDF
DevOps(3) : Ansible - (MOSG)
PPT
Learn basic ansible using docker
PDF
Preparation study of_docker - (MOSG)
PDF
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
PDF
Ansible 實戰:top down 觀點
PPTX
Vagrant to-aws-flow
PDF
DevOps(2) : Vagrant - (MOSG)
PDF
Making environment for_infrastructure_as_code
PDF
Take control of your Jenkins jobs via job DSL.
PDF
Vagrant for real (codemotion rome 2016)
PDF
Vagrant for real codemotion (moar tips! ;-))
PDF
Continuous infrastructure testing
PDF
Modern Infrastructure from Scratch with Puppet
PDF
Multi-provider Vagrant and Chef: AWS, VMware, and more
PPTX
Installaling Puppet Master and Agent
PDF
Investigation of testing with ansible
PDF
Ansible not only for Dummies
PPTX
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
Instruction: dev environment
Steamlining your puppet development workflow
DevOps(3) : Ansible - (MOSG)
Learn basic ansible using docker
Preparation study of_docker - (MOSG)
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Ansible 實戰:top down 觀點
Vagrant to-aws-flow
DevOps(2) : Vagrant - (MOSG)
Making environment for_infrastructure_as_code
Take control of your Jenkins jobs via job DSL.
Vagrant for real (codemotion rome 2016)
Vagrant for real codemotion (moar tips! ;-))
Continuous infrastructure testing
Modern Infrastructure from Scratch with Puppet
Multi-provider Vagrant and Chef: AWS, VMware, and more
Installaling Puppet Master and Agent
Investigation of testing with ansible
Ansible not only for Dummies
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
Ad

Similar to Building and Testing from Scratch a Puppet Environment with Docker - PuppetConf 2014 (20)

PDF
Building and Testing Puppet with Docker
PDF
DevOps Braga #6
ODP
Puppet slides for intelligrape
PDF
Automating Docker Containers with Puppet 2014 10-13
PPTX
Puppet quick start guide
PDF
Complementing Docker with Puppet
PPTX
Beyond Golden Containers: Complementing Docker with Puppet
PPT
Puppet
PPT
Scalable systems management with puppet
PPT
Scalable Systems Management with Puppet
PDF
Writing and Publishing Puppet Modules - PuppetConf 2014
PDF
PuppetCamp SEA 1 - Use of Puppet
PDF
PuppetCamp SEA 1 - Use of Puppet
PPTX
Puppet in k8s, Miroslav Hadzhiev
PDF
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PDF
Learning Puppet Chapter 1
PPTX
Introduction to puppet - Hands on Session at HPI Potsdam
PDF
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
PDF
Puppet Camp Duesseldorf 2014: Thomas Gelf - Puppet CA: certificates explained
PDF
Puppet Camp Düsseldorf 2014: Puppet CA Certificates Explained
Building and Testing Puppet with Docker
DevOps Braga #6
Puppet slides for intelligrape
Automating Docker Containers with Puppet 2014 10-13
Puppet quick start guide
Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppet
Puppet
Scalable systems management with puppet
Scalable Systems Management with Puppet
Writing and Publishing Puppet Modules - PuppetConf 2014
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
Puppet in k8s, Miroslav Hadzhiev
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
Learning Puppet Chapter 1
Introduction to puppet - Hands on Session at HPI Potsdam
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Duesseldorf 2014: Thomas Gelf - Puppet CA: certificates explained
Puppet Camp Düsseldorf 2014: Puppet CA Certificates Explained
Ad

More from Puppet (20)

PPTX
Puppet Community Day: Planning the Future Together
PPTX
The Evolution of Puppet: Key Changes and Modernization Tips
PPTX
Can You Help Me Upgrade to Puppet 8? Tips, Tools & Best Practices for Your Up...
PPTX
Bolt Dynamic Inventory: Making Puppet Easier
PPTX
Customizing Reporting with the Puppet Report Processor
PPTX
Puppet at ConfigMgmtCamp 2025 Sponsor Deck
PPTX
The State of Puppet in 2025: A Presentation from Developer Relations Lead Dav...
PPTX
Let Red be Red and Green be Green: The Automated Workflow Restarter in GitHub...
PDF
Puppet camp2021 testing modules and controlrepo
PPTX
Puppetcamp r10kyaml
PDF
2021 04-15 operational verification (with notes)
PPTX
Puppet camp vscode
PDF
Modules of the twenties
PDF
Applying Roles and Profiles method to compliance code
PPTX
KGI compliance as-code approach
PDF
Enforce compliance policy with model-driven automation
PDF
Keynote: Puppet camp compliance
PPTX
Automating it management with Puppet + ServiceNow
PPTX
Puppet: The best way to harden Windows
PPTX
Simplified Patch Management with Puppet - Oct. 2020
Puppet Community Day: Planning the Future Together
The Evolution of Puppet: Key Changes and Modernization Tips
Can You Help Me Upgrade to Puppet 8? Tips, Tools & Best Practices for Your Up...
Bolt Dynamic Inventory: Making Puppet Easier
Customizing Reporting with the Puppet Report Processor
Puppet at ConfigMgmtCamp 2025 Sponsor Deck
The State of Puppet in 2025: A Presentation from Developer Relations Lead Dav...
Let Red be Red and Green be Green: The Automated Workflow Restarter in GitHub...
Puppet camp2021 testing modules and controlrepo
Puppetcamp r10kyaml
2021 04-15 operational verification (with notes)
Puppet camp vscode
Modules of the twenties
Applying Roles and Profiles method to compliance code
KGI compliance as-code approach
Enforce compliance policy with model-driven automation
Keynote: Puppet camp compliance
Automating it management with Puppet + ServiceNow
Puppet: The best way to harden Windows
Simplified Patch Management with Puppet - Oct. 2020

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
KodekX | Application Modernization Development
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Encapsulation theory and applications.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
Digital-Transformation-Roadmap-for-Companies.pptx
Network Security Unit 5.pdf for BCA BBA.
Dropbox Q2 2025 Financial Results & Investor Presentation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
KodekX | Application Modernization Development
Chapter 3 Spatial Domain Image Processing.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Per capita expenditure prediction using model stacking based on satellite ima...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
Reach Out and Touch Someone: Haptics and Empathic Computing
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Encapsulation theory and applications.pdf
NewMind AI Weekly Chronicles - August'25 Week I

Building and Testing from Scratch a Puppet Environment with Docker - PuppetConf 2014