SlideShare a Scribd company logo
Publishing A Module On The Puppet Forge 
An introduction to packaging your module and sharing it with the community 
Bill Fraser 
February 25, 2014
Agenda 
• 
Introduction 
• 
Why you should publish your module 
• 
What is a module, anyway? 
• 
Managing configuration with style! 
• 
Continuous integration 
• 
Next steps 
• 
Q & A 
2 © 2014 Pythian
Introduction 3 © 2014 Pythian
Why Publish A Module? 
• 
Major strength of Puppet 
• 
Over 2000 modules 
• 
Integration via Puppet Module Tool 
• 
Metadata (version, release date, downloads) 
• 
Searchable 
• 
Documentation (requirements, parameters, usage) 
• 
Giving back to the community 
4 © 2014 Pythian
Truth In Advertising 
• 
Documentation exists 
• 
Adheres to best practice 
• 
Dependency resolution 
• 
Semantic versioning 
• 
Automated test and build 
5 © 2014 Pythian
What Is A Module? 
1. 
Identify Problem 
2. 
Solve Problem 
3. 
??? 
4. 
Profit! 
6 © 2014 Pythian
What Is A Module? 
/etc/puppet/modules/widget/manifests/init.pp 7 © 2014 Pythian
What Is A Module? 
• 
widget – Top-level matches the name of the module 
– 
manifests/ – All of the manifests for the module 
• 
init.pp – Main class definition for the module 
• 
doodad.pp – Class named widget::doodad 
– 
files/ – Location for static files 
– 
lib/ – Contains plugins, custom facts / resources 
– 
templates/ – Contains templates 
– 
tests/ – Examples of how to declare classes / types 
– 
spec/ – Contains spec tests 
8 © 2014 Pythian
puppet module generate 
• 
Modulefile 
– 
Module metadata 
– 
Dependency information 
9 © 2014 Pythian 
• 
README 
• 
spec_helper.rb
Managing Configuration With Style! 
• 
“Just because you can, doesn’t mean you should” 
• 
By Conforming to the style guide, you ensure that 
– 
You follow best practice in module design and style 
– 
Your module is readable and therefore easier to maintain 
– 
Your module will work with an ENC without requiring one 
– 
You do not inherit or declare other classes unless you need to 
• 
puppet-lint is your friend! 
10 © 2014 Pythian
puppet-lint 
• 
Install puppet-lint 11 © 2014 Pythian 
• 
Run puppet-lint 
• 
But wait, let’s make it more awesome!
puppet-lint 
• 
Gemfile 12 © 2014 Pythian 
• 
Rakefile
Continuous Integration 
• 
Automatic testing against multiple Ruby and / or Puppet versions 
• 
Travis CI and GitHub 
– 
Sign in through GitHub OAuth and grant read and write access to GitHub 
– 
Activate GitHub service hooks 
– 
Add .travis.yml to your module repository 
– 
Validate your .travis.yml file with travis-lint 
– 
Trigger a build 
13 © 2014 Pythian
Continuous Integration 
Add .travis.yml to your module repository 
14 © 2014 Pythian
Continuous Integration 15 © 2014 Pythian
Next Steps 
• 
Test Driven Development (TDD) 
• 
Behaviour Driven Development (BDD) 
• 
rspec-puppet 
• 
rspec-system 16 © 2014 Pythian
References 
• 
Puppet Forge: http://forge.puppetlabs.com/ 
• 
Style Guide: http://docs.puppetlabs.com/guides/style_guide.html 
• 
Publishing Modules on the Puppet Forge: http://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html 
• 
puppet-lint: http://puppet-lint.com/ 
• 
Travis CI: https://travis-ci.org/ 
• 
Pro Puppet, Second Edition: http://www.apress.com/9781430260400 
• 
GDash Module 
– 
Puppet Forge: http://forge.puppetlabs.com/bfraser/gdash 
– 
GitHub: https://github.com/bfraser/puppet-gdash 
17 © 2014 Pythian
Questions? 
Thank you! 
Bill Fraser 
fraser@pythian.com 
18 © 2014 Pythian

More Related Content

ODP
Selenium at Mozilla: An Essential Element to our Success
PPTX
How Build Infrastructure Powers the Node.js Foundation
PPT
Node.js what's next (Index 2018)
PDF
It Takes a Village to Make WordPress
PPTX
Mini-training: Let’s Git It!
PPTX
Introduction to apache maven
PDF
Accelerate and unify network deployment with Puppet on Juniper
PDF
Git branching
Selenium at Mozilla: An Essential Element to our Success
How Build Infrastructure Powers the Node.js Foundation
Node.js what's next (Index 2018)
It Takes a Village to Make WordPress
Mini-training: Let’s Git It!
Introduction to apache maven
Accelerate and unify network deployment with Puppet on Juniper
Git branching

Viewers also liked (10)

PDF
Портал бюджета СПб
DOCX
орчуулга
PPT
детская организ
PPT
геом.та фіз.зміст пох.
PDF
Program edu germany(feb2012)_web
PPTX
виктория игоревна четвергова
PPT
Face To Face – The Globalization Of Philanthropy Pusteblume
PPT
система работы с одарёнными детьми в школе
DOCX
план 13 14 на весь год
Портал бюджета СПб
орчуулга
детская организ
геом.та фіз.зміст пох.
Program edu germany(feb2012)_web
виктория игоревна четвергова
Face To Face – The Globalization Of Philanthropy Pusteblume
система работы с одарёнными детьми в школе
план 13 14 на весь год
Ad

Similar to Ottawa Puppet User Group - Publishing a Module on the Puppet Forge (20)

PPTX
Publishing a Module on the Puppet Forge
PDF
Using Grunt with Drupal
PPTX
The Art & Zen of Managing Nagios with Puppet
KEY
Portable infrastructure with puppet
PDF
Your first d8 module
PPTX
The Evolution of Puppet: Key Changes and Modernization Tips
PDF
DEVASC_Module_1.pdf
PDF
Puppet Camp Portland: Nagios Management With Puppet (Beginner)
PPTX
The Art and Zen of Managing Nagios With Puppet
PDF
PuppetConf 2017: Puppet Development Kit: A Seamless Workflow for Module Devel...
PPTX
Warsaw MuleSoft Meetup #6 - CI/CD
PDF
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
PDF
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
PPTX
Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...
PDF
Week6 office-hours
PDF
Drupal upgrades and migrations. BAD Camp 2013 version
PPTX
Fluo CICD OpenStack Summit
PDF
Dipping Your Toe into Drupal 8 Module Development
PPTX
Continuous integration of_puppet_code
PDF
Puppet Camp Sydney 2015: The (Im)perfect Puppet Module
Publishing a Module on the Puppet Forge
Using Grunt with Drupal
The Art & Zen of Managing Nagios with Puppet
Portable infrastructure with puppet
Your first d8 module
The Evolution of Puppet: Key Changes and Modernization Tips
DEVASC_Module_1.pdf
Puppet Camp Portland: Nagios Management With Puppet (Beginner)
The Art and Zen of Managing Nagios With Puppet
PuppetConf 2017: Puppet Development Kit: A Seamless Workflow for Module Devel...
Warsaw MuleSoft Meetup #6 - CI/CD
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...
Week6 office-hours
Drupal upgrades and migrations. BAD Camp 2013 version
Fluo CICD OpenStack Summit
Dipping Your Toe into Drupal 8 Module Development
Continuous integration of_puppet_code
Puppet Camp Sydney 2015: The (Im)perfect Puppet Module
Ad

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation theory and applications.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Cloud computing and distributed systems.
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
cuic standard and advanced reporting.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
Spectral efficient network and resource selection model in 5G networks
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation theory and applications.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Network Security Unit 5.pdf for BCA BBA.
Cloud computing and distributed systems.
“AI and Expert System Decision Support & Business Intelligence Systems”
cuic standard and advanced reporting.pdf
Approach and Philosophy of On baking technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Review of recent advances in non-invasive hemoglobin estimation
sap open course for s4hana steps from ECC to s4
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
The AUB Centre for AI in Media Proposal.docx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Programs and apps: productivity, graphics, security and other tools

Ottawa Puppet User Group - Publishing a Module on the Puppet Forge

  • 1. Publishing A Module On The Puppet Forge An introduction to packaging your module and sharing it with the community Bill Fraser February 25, 2014
  • 2. Agenda • Introduction • Why you should publish your module • What is a module, anyway? • Managing configuration with style! • Continuous integration • Next steps • Q & A 2 © 2014 Pythian
  • 3. Introduction 3 © 2014 Pythian
  • 4. Why Publish A Module? • Major strength of Puppet • Over 2000 modules • Integration via Puppet Module Tool • Metadata (version, release date, downloads) • Searchable • Documentation (requirements, parameters, usage) • Giving back to the community 4 © 2014 Pythian
  • 5. Truth In Advertising • Documentation exists • Adheres to best practice • Dependency resolution • Semantic versioning • Automated test and build 5 © 2014 Pythian
  • 6. What Is A Module? 1. Identify Problem 2. Solve Problem 3. ??? 4. Profit! 6 © 2014 Pythian
  • 7. What Is A Module? /etc/puppet/modules/widget/manifests/init.pp 7 © 2014 Pythian
  • 8. What Is A Module? • widget – Top-level matches the name of the module – manifests/ – All of the manifests for the module • init.pp – Main class definition for the module • doodad.pp – Class named widget::doodad – files/ – Location for static files – lib/ – Contains plugins, custom facts / resources – templates/ – Contains templates – tests/ – Examples of how to declare classes / types – spec/ – Contains spec tests 8 © 2014 Pythian
  • 9. puppet module generate • Modulefile – Module metadata – Dependency information 9 © 2014 Pythian • README • spec_helper.rb
  • 10. Managing Configuration With Style! • “Just because you can, doesn’t mean you should” • By Conforming to the style guide, you ensure that – You follow best practice in module design and style – Your module is readable and therefore easier to maintain – Your module will work with an ENC without requiring one – You do not inherit or declare other classes unless you need to • puppet-lint is your friend! 10 © 2014 Pythian
  • 11. puppet-lint • Install puppet-lint 11 © 2014 Pythian • Run puppet-lint • But wait, let’s make it more awesome!
  • 12. puppet-lint • Gemfile 12 © 2014 Pythian • Rakefile
  • 13. Continuous Integration • Automatic testing against multiple Ruby and / or Puppet versions • Travis CI and GitHub – Sign in through GitHub OAuth and grant read and write access to GitHub – Activate GitHub service hooks – Add .travis.yml to your module repository – Validate your .travis.yml file with travis-lint – Trigger a build 13 © 2014 Pythian
  • 14. Continuous Integration Add .travis.yml to your module repository 14 © 2014 Pythian
  • 15. Continuous Integration 15 © 2014 Pythian
  • 16. Next Steps • Test Driven Development (TDD) • Behaviour Driven Development (BDD) • rspec-puppet • rspec-system 16 © 2014 Pythian
  • 17. References • Puppet Forge: http://forge.puppetlabs.com/ • Style Guide: http://docs.puppetlabs.com/guides/style_guide.html • Publishing Modules on the Puppet Forge: http://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html • puppet-lint: http://puppet-lint.com/ • Travis CI: https://travis-ci.org/ • Pro Puppet, Second Edition: http://www.apress.com/9781430260400 • GDash Module – Puppet Forge: http://forge.puppetlabs.com/bfraser/gdash – GitHub: https://github.com/bfraser/puppet-gdash 17 © 2014 Pythian
  • 18. Questions? Thank you! Bill Fraser fraser@pythian.com 18 © 2014 Pythian