diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-07 18:16:53 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-07 18:16:53 -0300 |
commit | b649e95885719b4f39ba17a1a9bdbc1f35d02c72 (patch) | |
tree | 8a80bf358bc7d47a15efcedc5dcc233a4b9b6ff3 | |
parent | 16907381b52064b3bdac600df6a0a28ed3d3ad8f (diff) | |
download | puppet-puppet-b649e95885719b4f39ba17a1a9bdbc1f35d02c72.tar.gz puppet-puppet-b649e95885719b4f39ba17a1a9bdbc1f35d02c72.tar.bz2 |
Make sure we have a puppet repo
-rw-r--r-- | manifests/master/update.pp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/manifests/master/update.pp b/manifests/master/update.pp index ddc8ba1..f996f86 100644 --- a/manifests/master/update.pp +++ b/manifests/master/update.pp @@ -2,6 +2,14 @@ class puppet::master::update( $ensure = present, $method = hiera('puppet::master::update::method', 'cron') ) { + # make sure we have a puppet repo + exec { "make-puppet-repo": + command => "/bin/sh -c 'mkdir -p /var/git/repositories/puppet.git && cd /var/git/repositories/puppet.git && git --bare init'", + unless => "/bin/sh -c '[ -e /var/git/repositories/puppet.git ]'", + user => gitolite, + require => [ User['gitolite'], File['/var/git/repositories'] ], + } + # puppet update script file { "/usr/local/sbin/update-puppet-conf.sh": source => "puppet:///modules/puppet/update-puppet-conf.sh", @@ -25,14 +33,15 @@ class puppet::master::update( # use a post-update hook file { '/var/git/repositories/puppet.git/hooks/post-update': - mode => 0750, - owner => gitolite, - group => gitolite, - ensure => $method ? { + mode => 0750, + owner => gitolite, + group => gitolite, + ensure => $method ? { 'cron' => $ensure, default => present, }, - source => "puppet:///modules/puppet/post-update.sh", + source => "puppet:///modules/puppet/post-update.sh", + require => Exec['make-puppet-repo'], } # needed by the post-update hook above |