diff options
-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 |