creating beautiful puppet modules with puppet-lint

Download Creating beautiful puppet modules with puppet-lint

Post on 13-Jun-2015




0 download

Embed Size (px)


Utah County Puppet user group Meeting on 2014-Oct-21: puppet-lint


  • 1. Creating beautifulPuppet moduleswith pupet-lint

2. $(whoami) 3. 4. => Packages=> Files=> Services 5. DSL?Ive got dual T1 uplinks 6. $package=openssh-serverif [`which yum`]; thenyum install $packageelif [`which apt-get`; thenapt-get install $packageelseecho Neither apt nor yum found; exit 1fi 7. $package=openssh-serverpackage { $package:ensure => present,} 8. class ssh {package {openssh-server:manifest init.ppensure => present,}file {/etc/ssh/sshd_config:content => puppet:///ssh/sshd_config',owner => root,require => Package[openssh-server],}service {sshd:ensure => running,require => [Package[openssh-server],File[/etc/ssh/ssd_}} 9. $ puppet module generate foo-bar$ mv foo-bar bar #bug PUP-3124$ tree bar/bar/ files manifests init.pp metadata.json spec templates tests init.ppbar module layout 10. Name your puppetmodules 11. There are two hard things in computer science:- cache invalidation- naming things- off-by-one errors.- Phil Karlton 12. Wrapper Module => devops/ac_mysqlBase Module => puppetlabs/mysql 13. Workshop 1 14. Puppet-lint 15. $ puppet parser validate *.pp$ puppet-lint *.ppalias ppv='puppet parser validate'alias ppl='puppet lint --no-80chars-check' 16. Workshop 2 17. Questions?