Skip to content

Instantly share code, notes, and snippets.

@hakamadare
Created July 5, 2013 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hakamadare/5936189 to your computer and use it in GitHub Desktop.
Save hakamadare/5936189 to your computer and use it in GitHub Desktop.
first whack at a wrapper for vcsrepo that fixes ownership
define vcsrepo_git_wrapper(
$source,
$ensure = 'present',
$excludes = false,
$force = false,
$group = 'root',
$identity = '~/.ssh/id_rsa',
$owner = 'root',
$revision = 'HEAD',
$user = 'root',
$mode = '0755'
) {
if $excludes {
validate_array($excludes)
}
vcsrepo { "${title}-vcsrepo":
ensure => $ensure,
path => $title,
source => $source,
excludes => $excludes,
force => $force,
group => $group,
identity => $identity,
owner => $owner,
revision => $revision,
user => $user,
}
file { "${title}-file":
ensure => 'directory',
path => $title,
owner => $owner,
group => $group,
mode => undef,
recurse => true,
source => undef,
require => Vcsrepo["${title}-vcsrepo"],
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment