Publishing a Module on the Puppet Forge

67 %
33 %
Information about Publishing a Module on the Puppet Forge

Published on March 4, 2014

Author: PuppetLabs



"Publishing a Module on the Puppet Forge" by Bill Fraser of Pythian at the Ottawa Puppet User Group, Feb 2014.

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 • • • • • • • 2 Introduction Why you should publish your module What is a module, anyway? Managing configuration with style! Continuous integration Next steps Q&A © 2014 Pythian

Introduction 3 © 2014 Pythian

Why Publish A Module? • • • • • • • 4 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 © 2014 Pythian

Truth In Advertising • • • • • 5 Documentation exists Adheres to best practice Dependency resolution Semantic versioning Automated test and build © 2014 Pythian

What Is A Module? 1. 2. 3. 4. 6 Identify Problem Solve Problem ??? Profit! © 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 README spec_helper.rb © 2014 Pythian

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 • Run puppet-lint • But wait, let’s make it more awesome! 11 © 2014 Pythian

puppet-lint • Gemfile • Rakefile 12 © 2014 Pythian

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 • • • • • • • 17 Puppet Forge: Style Guide: Publishing Modules on the Puppet Forge: puppet-lint: Travis CI: Pro Puppet, Second Edition: GDash Module – Puppet Forge: – GitHub: © 2014 Pythian

Questions? Thank you! Bill Fraser 18 © 2014 Pythian

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

Publishing Modules on the Puppet Forge — Documentation ...

Publishing Modules on the Puppet ForgeThe Puppet Forge is a community repository of modules, written and contributed by Puppet Open Source and Puppet ...
Read more

Puppet Forge

... sharable units of Puppet code. You can use modules to extend Puppet across your infrastructure by automating tasks such ... New to the Puppet Forge?
Read more

GitHub - cloudsmith/forge-publisher: The GitHub Publisher ... forge-publisher. The GitHub Publisher for Puppet Forge modules. The publisher is in the form of a Maven plug-in that in turn executes code from ...
Read more

Publishing Forge Modules | rnelson0

... "Build puppet module ... Publishing Forge Modules. ... but a utility module like the certs module is a good candidate. Publishing. Puppet Labs ...
Read more

Writing and Publishing Puppet Modules - Colleen Murphy ...

This talk is a beginner's guide to writing a module and publishing it on the Forge. ... Puppet Enterprise helps you automate repetitive tasks, ...
Read more

[PuppetConf 2014][Modules] Writing and Publishing Puppet ...

... [Modules] Writing and Publishing Puppet Modules ... writing a module and publishing it on the Forge. We write modules to solve problems ...
Read more

A note on upcoming module metadata improvements - Google ...

We've been working hard to reduce the complexity involved in publishing modules to the Forge and make it simpler to find great modules. I'm writing today ...
Read more

Puppet Forge

What does it mean to be Puppet Approved? ... See our module publishing documentation ... The Puppet Forge's API service is considered authoritative for any ...
Read more