forge "http://forge.puppetlabs.com"
mod 'puppetlabs/ruby'
mod 'puppetlabs/ntp'
mod 'puppetlabs/git'
mod 'puppetlabs/vcsrepo'
mod 'puppetlabs/apt'
mod 'puppetlabs/gcc'
Gareth Rushgrove
Slide 63
Slide 63 text
librarian-puppet install
Gareth Rushgrove
Slide 64
Slide 64 text
A Nice
Module Pattern
(Structuring modules for reuse)
Modules increasingly
take arguments
Gareth Rushgrove
Slide 107
Slide 107 text
Modules increasingly
have interfaces with
other modules
Gareth Rushgrove
Slide 108
Slide 108 text
Modules increasingly
used in many Ruby
and Puppet version
combinations
Gareth Rushgrove
Slide 109
Slide 109 text
Good news. The tools
got better
Gareth Rushgrove
Slide 110
Slide 110 text
puppet-lint
Gareth Rushgrove
Slide 111
Slide 111 text
Puppet
style guide
Slide 112
Slide 112 text
Available
as a gem
Slide 113
Slide 113 text
puppet-lint --with-filename /etc/puppet/modules
foo/manifests/bar.pp: trailing whitespace found
on line 1
apache/manifests/server.pp: variable not enclosed
in {} on line 56
Gareth Rushgrove
Test that Puppet runs
without errors
Gareth Rushgrove
Slide 139
Slide 139 text
it 'should run without errors' do
pp = "class { 'sample': }"
puppet_apply(pp) do |r|
r.exit_code.should == 2
end
end
Gareth Rushgrove
Slide 140
Slide 140 text
Test runs are
idempotent
Gareth Rushgrove
Slide 141
Slide 141 text
it 'should run without errors' do
pp = "class { 'sample': }"
puppet_apply(pp) do |r|
r.exit_code.should == 2
r.refresh
r.exit_code.should be_zero
end
end
Gareth Rushgrove
Slide 142
Slide 142 text
Test that the module
installs relevant
binaries
Gareth Rushgrove
Slide 143
Slide 143 text
it 'should install the erl binary' do
shell 'which erl' do |r|
r.stdout.should =~ /\/usr\/bin\/e
r.stderr.should be_empty
r.exit_code.should be_zero
end
end
Gareth Rushgrove
Slide 144
Slide 144 text
Test against different
operating systems
Gareth Rushgrove