1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
class base_installation::cronie inherits base_installation {
ensure_packages(['cronie'])
unless empty($base_installation::puppet_code_path) {
file { 'post-hook':
ensure => file,
path => "$base_installation::puppet_code_path/.git/hooks/post-merge",
source => 'puppet:///modules/base_installation/cronie/puppet-post-merge',
mode => '0755',
owner => root,
group => root,
}
cron { 'puppet-pull-apply':
ensure => present,
command => "cd $base_installation::puppet_code_path ; /usr/bin/git pull",
user => root,
minute => '*/30',
require => File['post-hook'],
}
cron { 'puppet-apply':
ensure => present,
command => "cd $base_installation::puppet_code_path ; puppet apply --test $base_installation::puppet_code_path/manifests/site.pp",
user => root,
minute => '*/20'
}
cron { 'puppet-apply-reboot':
ensure => present,
command => "cd $base_installation::puppet_code_path ; puppet apply --test $base_installation::puppet_code_path/manifests/site.pp",
user => root,
special => "reboot"
}
}
}
|