modern module development
TRANSCRIPT
Definitions
• ‘Module’ - code to install and configure a single piece of software
• ‘Roles and Profiles’ - code to compose modules in a more site-specific manner
What Now?
• Deploying a new technology != writing a new module
• Start with the Puppet Forge
• Check GitHub
Approved Modules• Nominated by module authors or community
members
• Nominations reviewed by modules team
• Checked for functionality and following best practices
• Evaluated against comparable modules
• Nominate a module you love today!
Module Scoring System
• Lint checking
• Puppet compatibility
• Metadata checking
• Community ratings
Does It Work For You?
• Check the module documentation
• See if the module can generate your existing configuration
• How customizable is it?
Other Checks
• Is the module actively maintained?
• Are issues and pull requests responded to?
• Can the module get you close to your configuration?
• Does the module follow best practices?
Write The Module You Want
• Writing generic modules is hard
• Iterative development helps
• You don’t have to do it alone
Scoping, Scoping, Scoping
• Only manage a single thing
• Avoid monolithic modules
• Tighter scope == greater flexibility
Checking Your Work
• Unit and acceptance tests for all new modules
• Unit tests for most new features
• Acceptance tests for new big features
• Lower overhead
• Verify against catalog
• Test for compilation
• Exercise parameters
• More overhead
• Verify against running system
• Full path test of software
• Check for config correctness
Unit Tests Acceptance Tests
Danger Zone
Do not run acceptance tests anywhere but on a test system or virtual machine.
Acceptance tests occasionally have bugs that can be very destructive (rm -rf /)
puppet-community
• GitHub organization
• Modules and tooling maintained by and for the Puppet community
• Reach out to @daenney and @hirojin if you need more information!
Development Toolkit
• Brand New Puppet Language Style Guide
• Consistency with ModuleSync
• #puppet-dev on freenode
• Each node has a single role
• Each role is composed of one or many profiles
• Each profile is composed of other profiles or modules
Links!• Nominate approved: https://tickets.puppetlabs.com/browse/
MODULES/component/12141
• Style Guide: https://docs.puppetlabs.com/guides/style_guide.html
• ModuleSync: https://github.com/puppetlabs/modulesync
• puppet-community: http://puppet-community.github.io/
• Roles and Profiles: http://www.craigdunn.org/2012/05/239/
• Puppet User Group: http://puppetlabs.com/community/PUG