A simple search for "puppet-apache" on GitHub returns 70 separate repositories. An awful lot of people are busy reinventing the same configuration wheel. Configuration management tools promise write once, run anywhere code; but writing code that can be used by anyone looks like a lot of work. This presentation aims to show anyone familiar with Puppet how to write reusable modules and importantly how to make them compatible with already shared modules released on the Forge or elsewhere. We'll look at when and why testing a declarative language is actually useful, examples of good and bad modules and how to re-factor puppet code for re-usability. We'll also talk about potential improvements to Puppet that would make reuse easier.
Gareth Rushgrove
Technical Architect, Government Digital Service
Gareth Rushgrove is now a technical architect at the Government Digital Service, part of the UK Government. He is mainly interested in configuration management, infrastructure and platform as a service, deployment and monitoring tooling and the whole devops community. He thinks when used well together these allow you to move really fast, even in tightly controlled environments like Government. When not working, Gareth can be found blogging over on morethanseven.net or uploading code to GitHub. He also curates the Devops Weekly newsletter and occasionally organises community events.
141. 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
142. Test that the module
installs relevant
binaries
Gareth Rushgrove
143. 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