finger-puppet
finger-puppet helps you run Puppet locally against a Git checkout.
finger-puppet encourages a Puppet workflow where you quickly + iteratively develop your Puppet manifests on a single machine, then push your changes up to a repository to deploy to the rest of your infrastructure.
This workflow also complements a Capistrano or MCollective-style deployment, where you remotely instruct finger-puppet to check out a copy of the latest manifests and run them.
finger-puppet also has the ability to freeze Puppet in to the manifests repository, letting you quickly test different versions of Puppet without waiting for packages to appear, and reducing the dependencies on a system to run Puppet down to just Ruby and git.
This is originally forked from the the work of rump by railsmachine, my rationale for renaming and re-releasing was because it had become overly burdensome to manually build the gem on each system i was going to do an intitial deploy with from git, and had no feedback despite asking for a new version of the gem to get pushed, original source code here: https://github.com/railsmachine/rump
Installing
$ gem install finger-puppet
Using finger-puppet
Make sure you check out the man pages.
Check out your repository of Puppet manifests:
$ finger-puppet clone git@github.com:me_at_example_dot_org/puppet.git
Now cd
into the directory, and do a Puppet run:
$ sudo finger-puppet go
When you make changes, run Puppet through finger-puppet:
$ sudo finger-puppet go
You can append options you'd normally pass to the puppet
command at the end
of finger-puppet go
:
$ sudo finger-puppet go --verbose --debug --noop
There's nothing stopping you from running finger-puppet against different checkouts/branches of manifests. This is especially powerful when developing locally with the following workflow:
finger-puppet clone git@github.com:me_at_example_dot_org/puppet.git
finger-puppet go
cd puppet && git checkout -b new_feature
- Make your changes &&
finger-puppet go --noop
to see what will change. - Apply the changes with
finger-puppet go
- Iterate until everything's working
git checkout master && git merge new_feature
git push
Freezing Puppet
Alternatively, if you want to live on the bleeding edge and eschew your distribution's packages, you can run finger-puppet entirely from RubyGems or Git. This gives you a whole bunch of advantages:
- You only need Ruby installed on your system to run Puppet
- A checkout of your manifests also gives you Puppet
- Bind your manifests to a particular version of Puppet
- Test your manifests against new versions of Puppet in a separate branch
- Manage upgrades of Puppet outside your operating system's release cycle
You can freeze Puppet and it's dependencies very easily:
$ finger-puppet freeze
This will freeze Puppet + Facter under vendor/
, using Bundler.
When you run finger-puppet go
, finger-puppet checks whether you have frozen Puppet + Facter, and
runs the frozen Puppet if available.
You can manage the versions of Puppet you want frozen using the Gemfile
at
the root of your project. To use a specific version of Puppet, edit your
Gemfile
:
source :rubygems
gem "puppet", "2.6.4"
If you want to live on the bleeding edge, you can run Puppet out of git:
source :rubygems
gem "puppet", "2.6.7", :git => "git://github.com/puppetlabs/puppet.git", :tag => "2.7.0rc1"
gem "facter", "1.5.8", :git => "git://github.com/puppetlabs/facter.git", :tag => "1.5.9rc5"
Any dependency you bundle will automatically be added to the load path when you
run finger-puppet go
.
Developing + Testing finger-puppet
Check out the repository, and run bundle install
to suck down all the
required development dependencies.
There's a suite of Cucumber tests to fully exercise finger-puppet in features/
:
$ cucumber features/
The scenarios are tagged with @offline
and @online
, depending on whether
the test requires internet connectivity. Run all but @online
tests with:
$ cucumber --tags ~@online features/
Quirks
-
Puppet's fileserver (
source => "puppet:///..."
on File resources) doesn't behave as expected on Puppet < 2.6. If you are using Puppet < 2.6, all files need to be templates. -
Manifests need to be in modules so Puppet can pick them up correctly.
License
Original Copyright Rails Machine LLC 2010-2011, released under the LGPL.
Copyright Somerset Technical Solutions LTD 2011 released under the LGPL.
See LICENSE for more info.