[TODO, ONHOLD] pp-misc - miscellaneous puppet modules
Puppet
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
features
pp/modules
stow
.gitignore
README.md

README.md

File        : README.md
Maintainer  : Felix C. Stegerman <flx@obfusk.net>
Date        : 2013-09-26

Copyright   : Copyright (C) 2013  Felix C. Stegerman

Description

pp-misc - miscellaneous puppet modules

ffile module

The ffile module creates a file by copying the first existing file in:

  • puppet:///modules/site/ffile/${f}-${::fqdn}
  • puppet:///modules/ffile/${f}-${::fqdn}
  • puppet:///modules/site/ffile/${f}-${::hostname}
  • puppet:///modules/ffile/${f}-${::hostname}
  • puppet:///modules/site/ffile/${f}
  • puppet:///modules/ffile/${f}

Where $f is either the $path of the file; or $from, if specified.

Examples:

ffile { "/some/file/some/where": }

ffile { "/some/other/file":
  from => 'some_other_file',
}

ffile { "/some/file/somewhere/else":
  owner => 'felix',
  group => 'felix',
  mode  => 600,
}

git module

The git module lets you clone a git repo to a specific path, optionally specifying a branch to clone, or a branch to checkout from a specific commit. You can have puppet pull the repo every time it is run, or leave it alone after the initial clone. You can specify whether git output should be shown by puppet; the user to run the command as; and the timeout.

Requires: Package['git'].

Examples:

git::repo { "/path/to/dir1":
  source    => 'https://example.com/repo1.git',
  branch    => 'dev',
  log       => on_failure,
}

git::repo { "/path/to/dir2":
  source    => 'https://example.com/repo2.git',
  branch    => 'dev',
  pull      => true,
  log_pull  => on_failure,
}

git::repo { "/path/to/dir3":
  source    => 'https://example.com/repo3.git',
  checkout  => ['foo', '5321cbf'],
}

mkdir_p module

The mkdir_p module lets you use mkdir -p from puppet. Because creating a parent directory for a puppet-managed dir or file is also useful, there is also mkdir_p::dirname which mkdir -p's the dirname of the specified path.

Examples:

mkdir_p { "/path/to/some/dir1": }
mkdir_p::dirname { "/path/to/some/dir2/file": }

Tests

To run the tests, you will need a meta-project like https://github.com/obfusk/pp-meta.

TODO

  • test user/timeout?
  • more specs/docs?
  • ...

License

GPLv2 [1] or EPLv1 [2].

References

[1] GNU General Public License, version 2 --- http://www.opensource.org/licenses/GPL-2.0

[2] Eclipse Public License, version 1 --- http://www.opensource.org/licenses/EPL-1.0