diff options
Diffstat (limited to 'modules/cron_puppet')
-rw-r--r-- | modules/cron_puppet/files/post-merge | 4 | ||||
-rw-r--r-- | modules/cron_puppet/manifests/init.pp | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/modules/cron_puppet/files/post-merge b/modules/cron_puppet/files/post-merge index 1ba08fb..ac5e3ff 100644 --- a/modules/cron_puppet/files/post-merge +++ b/modules/cron_puppet/files/post-merge | |||
@@ -1,7 +1,7 @@ | |||
1 | #!/bin/bash -e | 1 | #!/bin/bash |
2 | ## Run Puppet locally using puppet apply | 2 | ## Run Puppet locally using puppet apply |
3 | git submodule update --init | 3 | git submodule update --init |
4 | /usr/bin/puppet apply --modulepath=/etc/puppetlabs/puppet/modules /etc/puppetlabs/puppet/manifests/site.pp | 4 | /usr/bin/puppet apply `pwd`/manifests/site.pp |
5 | 5 | ||
6 | ## Log status of the Puppet run | 6 | ## Log status of the Puppet run |
7 | if [ $? -eq 0 ] | 7 | if [ $? -eq 0 ] |
diff --git a/modules/cron_puppet/manifests/init.pp b/modules/cron_puppet/manifests/init.pp index 1756a06..c9d5a51 100644 --- a/modules/cron_puppet/manifests/init.pp +++ b/modules/cron_puppet/manifests/init.pp | |||
@@ -1,7 +1,9 @@ | |||
1 | class cron_puppet { | 1 | class cron_puppet ( |
2 | $code_path = "/etc/puppetlabs/code" | ||
3 | ) { | ||
2 | file { 'post-hook': | 4 | file { 'post-hook': |
3 | ensure => file, | 5 | ensure => file, |
4 | path => '/etc/puppetlabs/puppet/.git/hooks/post-merge', | 6 | path => "$code_path/.git/hooks/post-merge", |
5 | source => 'puppet:///modules/cron_puppet/post-merge', | 7 | source => 'puppet:///modules/cron_puppet/post-merge', |
6 | mode => '0755', | 8 | mode => '0755', |
7 | owner => root, | 9 | owner => root, |
@@ -12,7 +14,7 @@ class cron_puppet { | |||
12 | } | 14 | } |
13 | cron { 'puppet-apply': | 15 | cron { 'puppet-apply': |
14 | ensure => present, | 16 | ensure => present, |
15 | command => "cd /etc/puppetlabs/puppet ; /usr/bin/git pull", | 17 | command => "cd $code_path ; /usr/bin/git pull", |
16 | user => root, | 18 | user => root, |
17 | minute => '*/30', | 19 | minute => '*/30', |
18 | require => File['post-hook'], | 20 | require => File['post-hook'], |