Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

215 lines (150 sloc) 7.297 kB
finger-puppet
====
## NAME ##
finger-puppet - Do Puppet runs locally from a Git checkout
## SYNOPSIS ##
* `finger-puppet` go [<puppet-options>]
* `finger-puppet` clone <repository> [directory]
* `finger-puppet` freeze [<project> <repository> --release=<release>]
* `finger-puppet` whoami [rfc2822-address]
* `finger-puppet` init <project>
* `finger-puppet` scaffold <project>
## DESCRIPTION ##
**finger-puppet** helps you run Puppet locally against a Git checkout.
finger-puppet supports 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.
## COMMANDS ##
* `clone`:
Clone a git repository of Puppet manifests.
<repository> is the url of a git repository. Essentially invokes
`git clone`. If [directory] is specified, will clone the repository into
the specified directory.
* `freeze`:
Freeze an arbitrary git repository into the current git repository as a
submodule under `vendor/`.
With no arguments, `freeze` will freeze in Puppet + Facter, to the latest
commit on master. This is especially useful if you want to track the latest
development release of Puppet.
If <project> and <repository> are specified, a git repository is cloned
and set up as a submodule under `vendor/`.
If `--release` is specified, `freeze` will create and switch to a branch
matching a particular tag or revision. Use this to lock to a specific
version of Puppet.
Once the repository is frozen in, switch between tagged releases by `cd`ing
to the repository under vendor and running `git checkout <tag>`.
Any repository frozen under `vendor/` will be added to the Puppet load path
when using `finger-puppet go`.
* `go`:
Do a Puppet run. Assumes the current directory is a repository of Puppet
manifests.
<puppet-options> are any options you can pass to `puppet` on the command
line (e.g. `--debug`, `--verbose`, `--tags foobar`).
* `help`:
Display the man page.
* `init`:
Initialise a repo of scaffolded Puppet manifests. Generates scaffolding for
a repository of Puppet manifests, and `git init`s the repository.
* `scaffold`:
Generate scaffolding for a repository of Puppet manifests, primed for finger-puppet.
Called by `init`. You should never have to call this manually.
* `whoami`:
Sets `user.name` and `user.email` using `git config`. Useful if you have
multiple users working with the repository from the same UNIX account.
If no arguments are specified, will output the currently configured name
and email.
If an argument is specified, treat the argument as an RFC2822 formatted
email address, e.g. John Doe <john@example.org>. Sets `user.name` and
`user.email` with `git config`.
Modelled on `bzr whoami`.
## OPTIONS
* `--help|-h`:
Display the man page.
## RETURN VALUES ##
* **0**: Command completed successfully.
* **1**: Argument error.
* **2**: Subcommand error.
* **3**: Required frozen submodule doesn't exist.
## QUIRKS ##
1. 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.
## EXAMPLES ##
Initialise a finger-puppet-ready Puppet repository:
$ finger-puppet init barfoo
Initialized empty Git repository in barfoo/.git/
Clone a git repository of Puppet manifests:
$ finger-puppet clone git@github.com:exampledotorg/manifests.git
Clone a git repository of Puppet manifests into a specific directory:
$ finger-puppet clone git@github.com:exampledotorg/manifests.git another_clone
Graft a finger-puppet scaffold onto an existing repository of manifests:
$ finger-puppet scaffold another_clone
Freeze Puppet and Facter:
$ finger-puppet freeze
Cloning into vendor/puppet...
remote: Counting objects: 72007, done.
remote: Compressing objects: 100% (22120/22120), done.
remote: Total 72007 (delta 52640), reused 66470 (delta 48322)
Receiving objects: 100% (72007/72007), 12.13 MiB | 253 KiB/s, done.
Resolving deltas: 100% (52640/52640), done.
Cloning into vendor/facter...
remote: Counting objects: 4185, done.
remote: Compressing objects: 100% (1930/1930), done.
remote: Total 4185 (delta 2202), reused 3973 (delta 2095)
Receiving objects: 100% (4185/4185), 840.81 KiB | 174 KiB/s, done.
Resolving deltas: 100% (2202/2202), done.
Freezing complete.
Freeze some other repository:
$ finger-puppet freeze moonshine https://github.com/railsmachine/moonshine.git
Cloning into vendor/moonshine...
remote: Counting objects: 4122, done.
remote: Compressing objects: 100% (1976/1976), done.
remote: Total 4122 (delta 2190), reused 3730 (delta 1911)
Receiving objects: 100% (4122/4122), 543.59 KiB | 58 KiB/s, done.
Resolving deltas: 100% (2190/2190), done.
Freezing complete.
Freeze Puppet at a particular version:
$ finger-puppet freeze puppet git://github.com/puppetlabs/puppet.git --release=2.6.2
Cloning into /Users/auxesis/foobar/vendor/puppet...
remote: Counting objects: 72007, done.
remote: Compressing objects: 100% (22120/22120), done.
remote: Total 72007 (delta 52640), reused 66470 (delta 48322)
Receiving objects: 100% (72007/72007), 12.13 MiB | 238 KiB/s, done.
Resolving deltas: 100% (52640/52640), done.
Switched to a new branch '2.6.2'
Freezing complete.
Do a Puppet run:
$ finger-puppet go
You should probably be root when running this! Proceeding anyway...
Using frozen Puppet from vendor/puppet.
notice: Finished catalog run in 0.01 seconds
Do a Puppet run, and pass in arguments to Puppet:
$ finger-puppet go --noop --debug
You should probably be root when running this! Proceeding anyway...
Using frozen Puppet from vendor/puppet.
ruby -I vendor/facter/lib -I vendor/puppet/lib vendor/puppet/bin/puppet
--modulepath modules --confdir etc --vardir var manifests/site.pp --noop --debug
debug: Creating default schedules
debug: Failed to load library 'selinux' for feature 'selinux'
debug: Puppet::Type::File::ProviderMicrosoft_windows: feature microsoft_windows is missing
debug: Failed to load library 'ldap' for feature 'ldap'
debug: Failed to load library 'shadow' for feature 'libshadow'
...
Find out who the currently configured git user is:
$ finger-puppet whoami
Jane Doe <jane@example.org>
Set the git user:
$ finger-puppet whoami 'John Doe <john@example.org>'
## AUTHOR ##
Lindsay Holmwood <lindsay@holmwood.id.au>
## COPYRIGHT ##
Copyright Rails Machine LLC 2010-2011, released under the LGPL
## SEE ALSO ##
puppet(8)
Jump to Line
Something went wrong with that request. Please try again.