Multiple approaches to
managing your Puppet
modules
Puppet Camp Chicago
2014-08-19
Chicago, IL
LearnPuppet.com
Garrett Honeycutt
gh@learnpuppet.com
@learnpuppet
# whoami
© 2014 GH Solutions, LLC
LearnPuppet.com
Audits
Consulting
Training
Advanced Topics with Test Driven Development
© 2014 GH Solutions, LLC
© 2014 GH Solutions, LLC
© 2014 GH Solutions, LLC
What is a Module?
© 2014 GH Solutions, LLC
Modules
A module is a self contained directory structure for encapsulating
puppet code.
© 2014 GH Solutions, LLC
Metadata
# Modulefile
name 'ghoneycutt-nscd'
version '1.0.2'
source 'git://github.com/ghoneycutt/puppet-module-nscd.git'
author 'ghoneycutt'
license 'Apache License, Version 2.0'
summary 'manage NSCD - name service cache daemon'
description 'Manage every aspect of NSCD - name service cache daemon'
project_page 'https://github.com/ghoneycutt/puppet-module-nscd'
dependency 'puppetlabs/stdlib', '>= 3.2.0'
© 2014 GH Solutions, LLC
Metadata
# metadata.json
{
"name": "ghoneycutt-nscd",
"version": "1.0.2",
"author": "ghoneycutt",
"summary": "manage NSCD - name service cache daemon",
"license": "Apache License, Version 2.0",
"source": "git://github.com/ghoneycutt/puppet-module-nscd.git",
"project_page": "https://github.com/ghoneycutt/puppet-module-nscd",
"issues_url": "https://github.com/ghoneycutt/puppet-module-nscd/issues",
"description": "Manage every aspect of NSCD - name service cache daemon",
"dependencies": [
{"name":"puppetlabs/stdlib","version_requirement":">= 3.2.0"}
]
}
© 2014 GH Solutions, LLC
Skeleton
Provides a template for generating new modules
https://github.com/ghoneycutt/puppet-module-skeleton
$ git clone https://github.com/ghoneycutt/puppet-module-skeleton
$ VARDIR=`puppet config print vardir`
$ mkdir -p $VARDIR/puppet-module/skeleton/
$ rsync -avp --exclude .git puppet-module-skeleton/ 
$VARDIR/puppet-module/skeleton/
© 2014 GH Solutions, LLC
Generate a module
$ cd /etc/puppet/modules
$ puppet module generate <forgename>-<modulename>
$ mv <forgename-modulename> <modulename>
© 2014 GH Solutions, LLC
Components
ghoneycutt-motd
ghoneycutt-motd/.fixtures.yml
ghoneycutt-motd/.gitignore
ghoneycutt-motd/.travis.yml
ghoneycutt-motd/Gemfile
ghoneycutt-motd/LICENSE
ghoneycutt-motd/Modulefile
ghoneycutt-motd/README.md
ghoneycutt-motd/Rakefile
ghoneycutt-motd/manifests
ghoneycutt-motd/manifests/init.pp
ghoneycutt-motd/spec
ghoneycutt-motd/spec/classes
ghoneycutt-motd/spec/classes/init_spec.rb
ghoneycutt-motd/spec/fixtures
ghoneycutt-motd/spec/fixtures/manifests
ghoneycutt-motd/spec/fixtures/manifests/site.pp
ghoneycutt-motd/spec/fixtures/modules
ghoneycutt-motd/spec/spec_helper.rb
ghoneycutt-motd/tests
ghoneycutt-motd/tests/init.pp
In the beginning
© 2014 GH Solutions, LLC
In the beginning...
Things were simple. We stuck all of our modules into one repo.
Luke Kanies told me it was a good idea and we spent time
puppetizing the setup.
© 2014 GH Solutions, LLC
In the beginning...
That was 2008.
© 2014 GH Solutions, LLC
There are better ways!
© 2014 GH Solutions, LLC
Looking back
Everyone has to be on the same release cycle or you get
dependency issues.
© 2014 GH Solutions, LLC
Scale
This scales to one organization with one release cycle who are
not concerned with others using their code.
© 2014 GH Solutions, LLC
Pro's
Easy to get started
© 2014 GH Solutions, LLC
Con's
Everything is released at the same time
Promotes forking
Merge hell
© 2014 GH Solutions, LLC
Analysis
Avoid at all costs.
Separate repo for each module
© 2014 GH Solutions, LLC
Puppetfile
© 2014 GH Solutions, LLC
Puppetfile
Simple file that lists your modules, where to get them, and at what
version.
# git repo
mod 'nscd',
:git => 'git://github.com/ghoneycutt/puppet-module-nscd.git'
:ref => 'v1.0.0'
© 2014 GH Solutions, LLC
Puppetfile
Also supports the Puppet Forge
# puppet forge
forge 'https://forgeapi.puppetlabs.com'
mod 'puppetlabs/stdlib', '4.2.1'
© 2014 GH Solutions, LLC
Puppetfile
Can be validated and kept under revision control.
ruby -c Puppetfile
© 2014 GH Solutions, LLC
ghoneycutt's puppet-modules
https://github.com/ghoneycutt/puppet-modules
All of the modules and their dependencies that I write, use, and support.
apache inittab pam ruby
apt localization passenger selinux
common make pe_gem ssh
concat motd portage stdlib
dnsclient mysql postgresql sysklogd
facter network puppet timezone
firewall nfs puppetdb types
gcc nisclient r10k utils
git nrpe rancid vcsrepo
hosts nscd redhat vim
htpasswd nsswitch rpcbind wget
inifile ntp rsyslog xinetd
© 2014 GH Solutions, LLC
modulepath
© 2014 GH Solutions, LLC
Puppet < 3.6
Search path for modules
modulepath =
/etc/puppet/environments/$environment/modules:/etc/puppet/modules
© 2014 GH Solutions, LLC
Puppet >= 3.6
modulepath is deprecated
Warning: Setting modulepath is deprecated in puppet.conf. See
http://links.puppetlabs.com/env-settings-deprecations (at
/usr/lib/ruby/site_ruby/1.8/puppet/settings.rb:1095:in
`issue_deprecations')
© 2014 GH Solutions, LLC
Puppet >= 3.6
environmentpath = /etc/puppet/environments
basemodulepath = /etc/puppet/modules
© 2014 GH Solutions, LLC
environmentpath
A search path for directory environments. Under $environmentpath are directories for each
$environment and under those are modules and manifests.
/etc/puppet/environments
├── dev
│ ├── manifests
│ │ └── site.pp
│ └── modules
│ ├── apache
│ ├── ...
│ └── zookeeper
├── fix_it
│ ├── manifests
│ │ └── site.pp
│ └── modules
│ ├── apache
│ ├── ...
│ └── zookeeper
└── production
├── manifests
│ └── site.pp
└── modules
├── apache
├── ...
└── zookeeper
© 2014 GH Solutions, LLC
basemodulepath
Search path for global modules. This is essentially appended to the modulepath.
basemodulepath = /var/local/ghoneycutt-modules
© 2014 GH Solutions, LLC
Puppet Forge
© 2014 GH Solutions, LLC
Managed by Ryan
Coleman
@ryanycoleman
Puppet Forge
Repo of puppet modules with dependency tracking.
© 2014 GH Solutions, LLC
2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicago
Puppet Forge -- Demo Time
search
# puppet module search openstack
install
This is buggy!
# puppet module install puppetlabs-openstack -i /tmp
© 2014 GH Solutions, LLC
Search by metadata
© 2014 GH Solutions, LLC
Pro's
Great way to find new modules
Can filter by OS and Puppet version
Can install from command line
Resolves dependencies
© 2014 GH Solutions, LLC
Con's
Installing from the command line leaves
you without something to track in
version control
Resolving dependencies is buggy (fixes
have been coming in, Thanks!)
© 2014 GH Solutions, LLC
Analysis
Use the forge to find modules
Install from the command line when
developing to make note of your
dependencies
Potentially use forge in your Puppetfile
© 2014 GH Solutions, LLC
librarian-puppet
© 2014 GH Solutions, LLC
Written by Tim Sharpe
@rodjek
© 2014 GH Solutions, LLC
librarian-puppet
Iterates through Puppetfile and recursively solves dependencies
for you.
© 2014 GH Solutions, LLC
Installation
# sudo gem install -V librarian-puppet
Usage
# cd /path/to/dir_with_Puppetfile
# librarian-puppet install -v
© 2014 GH Solutions, LLC
Pro's
Uses a Puppetfile, so you have
something in version control
Handles dependencies
© 2014 GH Solutions, LLC
Con's
Handles dependencies - this is a
nightmare with a large set of diverse
modules
© 2014 GH Solutions, LLC
Analysis
After experiencing a lot of frustration with the dependency
management, I gave up on this and moved to librarian-puppet-
simple. Big props to Tim for writing this and Puppetfile which has
became a standard.
© 2014 GH Solutions, LLC
librarian-puppet-simple
© 2014 GH Solutions, LLC
Written by Dan Bode
@bodepd
© 2014 GH Solutions, LLC
librarian-puppet-simple
Iterates through Puppetfile without any dependency management.
© 2014 GH Solutions, LLC
Installation
# sudo gem install -V librarian-puppet-simple
Usage
Similar to librarian-puppet
# cd /path/to/dir_with_Puppetfile
# librarian-puppet install -v
© 2014 GH Solutions, LLC
Pro's
No dependency management
Uses a Puppetfile, so you have
something in version control
© 2014 GH Solutions, LLC
Con's
..nope..
© 2014 GH Solutions, LLC
Analysis
Dan is my hero. After becoming frustrated with librarian-puppet's
dependency management, this tool simply iterates over a list of
modules, which is awesomely simple.
© 2014 GH Solutions, LLC
r10k
© 2014 GH Solutions, LLC
Written by Adrien Thebo
@nullfinch
© 2014 GH Solutions, LLC
r10k
Creates an environment for every branch in your puppet-modules
git repo.
© 2014 GH Solutions, LLC
Installation
There's a module for that https://github.com/acidprime/r10k
© 2014 GH Solutions, LLC
Work flow
[foo@laptop]# git checkout -b fixit 
vi Puppetfile 
ruby -c Puppetfile 
git commit -a 
git push origin fixit
[root@puppet]# r10k deploy environment -vp 
service httpd graceful
© 2014 GH Solutions, LLC
Automate deploy step with ssh keys
# Hiera entry using ghoneycutt/ssh
ssh::keys:
r10k:
ensure: 'present'
user: 'root'
type: 'rsa'
key: 'AAAAB3Nz....'
options: 'command="/usr/bin/r10k deploy environment -vp 
&& /sbin/service httpd graceful"'
# ~/.ssh/config on your workstation
Host r10k
User root
Hostname puppet.example.com
IdentityFile /Users/gh/.ssh/r10k
[foo@laptop]# ssh r10k
© 2014 GH Solutions, LLC
Add a rake task
# Rakefile
task :deploy do
sh 'ssh r10k'
end
[foo@laptop]# rake deploy
© 2014 GH Solutions, LLC
Pro's
Make's it really easy to do development
Do not need access to the puppet
master
Uses a Puppetfile, so you have
something in version control
© 2014 GH Solutions, LLC
Con's
..nope..
You need a centralized git repo, which hopefully you already have
:)
© 2014 GH Solutions, LLC
Analysis
Thebo is my hero, r10k provides an easy work flow for developers
to make changes in their environment all without shell access on
the puppet master.
© 2014 GH Solutions, LLC
Continued Learning
© 2014 GH Solutions, LLC
Continued Learning
Puppet modules
Use my modules https://github.com/ghoneycutt/puppet-modules
and send me pull requests.
© 2014 GH Solutions, LLC
Continued Learning
Ruby
Follow facter and submit pull requests.
© 2014 GH Solutions, LLC
Continued Learning
Ask and Solve Puppet questions
https://ask.puppetlabs.com - Recommend the weekly digest.
© 2014 GH Solutions, LLC
Continued Learning
Puppet modules
Use my modules https://github.com/ghoneycutt/puppet-modules
and send me pull requests.
Ruby
Follow facter and submit pull requests.
Ask and Solve Puppet questions
https://ask.puppetlabs.com - Recommend the weekly digest.
© 2014 GH Solutions, LLC
Multiple approaches to
managing your Puppet
modules
Puppet Camp Chicago
2014-08-19
Chicago, IL
LearnPuppet.com
Garrett Honeycutt
gh@learnpuppet.com
@learnpuppet

More Related Content

PDF
Gearman work queue in php
PDF
Creando microservicios con java micro profile y tomee - CUNORI 2020
PDF
Introduction to Griffon
ODP
PHP Quality Assurance Workshop PHPBenelux
PPT
Maven 2.0 - Improve your build patterns
PDF
Cooking Perl with Chef
PDF
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
PDF
Let the contribution begin (EST futures)
Gearman work queue in php
Creando microservicios con java micro profile y tomee - CUNORI 2020
Introduction to Griffon
PHP Quality Assurance Workshop PHPBenelux
Maven 2.0 - Improve your build patterns
Cooking Perl with Chef
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Let the contribution begin (EST futures)

What's hot (20)

PPTX
Golang 101 for IT-Pros - Cisco Live Orlando 2018 - DEVNET-1808
PPTX
Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...
PDF
Rest, sockets em golang
PDF
Nas 也可以揀土豆
PPT
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
ODP
Aug penguin16
PDF
Google App Engine: Basic
PDF
Test Driven Development with Puppet
PDF
Puppet evolutions
PDF
Trying to build an Open Source browser in 2020
PPTX
Troubleshooting Puppet
PPTX
From Ant to Maven to Gradle a tale of CI tools for JVM
PDF
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
PDF
Dependencies Managers in C/C++. Using stdcpp 2014
PDF
GraphQL IN Golang
PDF
Automate Your Automation | DrupalCon Vienna
PDF
Configuring Highly Scalable Compile Masters, Vasco Cardoso, AWS
PDF
Virtual CD4PE Workshop
PDF
Mobile development in 2020
PDF
Expressive Microservice Framework Blastoff
Golang 101 for IT-Pros - Cisco Live Orlando 2018 - DEVNET-1808
Openstack Third-Party CI and the review of a few Openstack Infrastructure pro...
Rest, sockets em golang
Nas 也可以揀土豆
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
Aug penguin16
Google App Engine: Basic
Test Driven Development with Puppet
Puppet evolutions
Trying to build an Open Source browser in 2020
Troubleshooting Puppet
From Ant to Maven to Gradle a tale of CI tools for JVM
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Dependencies Managers in C/C++. Using stdcpp 2014
GraphQL IN Golang
Automate Your Automation | DrupalCon Vienna
Configuring Highly Scalable Compile Masters, Vasco Cardoso, AWS
Virtual CD4PE Workshop
Mobile development in 2020
Expressive Microservice Framework Blastoff
Ad

Similar to 2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicago (20)

PDF
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
PPTX
Apigee deploy grunt plugin.1.0
PDF
Lean Drupal Repositories with Composer and Drush
PDF
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
PDF
WordPress modern development
PDF
Git hooks
PPT
Open up your platform with Open Source and GitHub
PDF
Deploying Symfony | symfony.cat
PDF
Bringing-it-all-together-overview-of-rpm-packaging-in-fedora
PDF
DevOps Bootcamp course resource (1)-1-99.pdf
PDF
SF Gradle Meetup - Netflix OSS
PDF
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
PDF
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
PDF
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
PDF
PHP QA Tools
PPT
How to start your open source project
PDF
Keeping your build tool updated in a multi repository world
PDF
NLUUG Spring 2012 - OpenShift Primer
PDF
ZendCon 2015 - DevOps for Small Teams
PDF
Princeton RSE: Building Python Packages (+binary)
2014-11-11 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Seattle
Apigee deploy grunt plugin.1.0
Lean Drupal Repositories with Composer and Drush
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
WordPress modern development
Git hooks
Open up your platform with Open Source and GitHub
Deploying Symfony | symfony.cat
Bringing-it-all-together-overview-of-rpm-packaging-in-fedora
DevOps Bootcamp course resource (1)-1-99.pdf
SF Gradle Meetup - Netflix OSS
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
DevFest 2022 - GitHub Actions를 활용한 Flutter 배포 자동화하기
PHP QA Tools
How to start your open source project
Keeping your build tool updated in a multi repository world
NLUUG Spring 2012 - OpenShift Primer
ZendCon 2015 - DevOps for Small Teams
Princeton RSE: Building Python Packages (+binary)
Ad

More from garrett honeycutt (16)

PDF
20180823 - Sensu + Puppet
PDF
Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...
PDF
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
PDF
(2016-06-11) Packer: Make Multi-Platform Images
PDF
20150613 self-puppet v4-avoiding_dragons
PDF
20150314 - Functional Testing for Configuration Management @ Cascadia IT Con...
PDF
2014-11-14 - Why Test Driven Development (TDD) Works for Sysadmins @ LISA14
PDF
20140406 loa days-tdd-with_puppet_tutorial
PDF
TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07
PDF
20130407 load puppevtv3-and_hiera
KEY
20120331 - Expanded Intro to Puppet for LOAD
PDF
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
PDF
20110611 expanded intro-to_puppet_for_self
KEY
20100425 Configuration Management With Puppet Lfnw
PDF
Fighting Spam With A Perimeter Mail System 20071108 Sasag
PDF
20090514 Introducing Puppet To Sasag
20180823 - Sensu + Puppet
Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
(2016-06-11) Packer: Make Multi-Platform Images
20150613 self-puppet v4-avoiding_dragons
20150314 - Functional Testing for Configuration Management @ Cascadia IT Con...
2014-11-14 - Why Test Driven Development (TDD) Works for Sysadmins @ LISA14
20140406 loa days-tdd-with_puppet_tutorial
TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07
20130407 load puppevtv3-and_hiera
20120331 - Expanded Intro to Puppet for LOAD
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20110611 expanded intro-to_puppet_for_self
20100425 Configuration Management With Puppet Lfnw
Fighting Spam With A Perimeter Mail System 20071108 Sasag
20090514 Introducing Puppet To Sasag

Recently uploaded (20)

PDF
4 layer Arch & Reference Arch of IoT.pdf
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
Flame analysis and combustion estimation using large language and vision assi...
PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PPTX
Training Program for knowledge in solar cell and solar industry
PDF
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
PDF
Consumable AI The What, Why & How for Small Teams.pdf
PDF
UiPath Agentic Automation session 1: RPA to Agents
PDF
Comparative analysis of machine learning models for fake news detection in so...
PDF
STKI Israel Market Study 2025 version august
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
Getting started with AI Agents and Multi-Agent Systems
PPT
What is a Computer? Input Devices /output devices
PPTX
Modernising the Digital Integration Hub
PPTX
Configure Apache Mutual Authentication
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PPTX
Module 1 Introduction to Web Programming .pptx
4 layer Arch & Reference Arch of IoT.pdf
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
Flame analysis and combustion estimation using large language and vision assi...
Custom Battery Pack Design Considerations for Performance and Safety
Training Program for knowledge in solar cell and solar industry
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
Consumable AI The What, Why & How for Small Teams.pdf
UiPath Agentic Automation session 1: RPA to Agents
Comparative analysis of machine learning models for fake news detection in so...
STKI Israel Market Study 2025 version august
Taming the Chaos: How to Turn Unstructured Data into Decisions
OpenACC and Open Hackathons Monthly Highlights July 2025
A review of recent deep learning applications in wood surface defect identifi...
Getting started with AI Agents and Multi-Agent Systems
What is a Computer? Input Devices /output devices
Modernising the Digital Integration Hub
Configure Apache Mutual Authentication
sustainability-14-14877-v2.pddhzftheheeeee
Credit Without Borders: AI and Financial Inclusion in Bangladesh
Module 1 Introduction to Web Programming .pptx

2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicago