Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 215 lines (150 sloc) 7.297 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
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)
Something went wrong with that request. Please try again.