1 |
|
2 |
class puppet { |
3 |
class client { |
4 |
package { puppet: |
5 |
ensure => installed |
6 |
} |
7 |
|
8 |
service { puppet: |
9 |
ensure => running, |
10 |
hasstatus => true, |
11 |
subscribe => [ Package[puppet]] |
12 |
} |
13 |
|
14 |
exec { "service puppet reload": |
15 |
refreshonly => true, |
16 |
subscribe => [ File["puppet.conf"] ], |
17 |
} |
18 |
|
19 |
file { "puppet.conf": |
20 |
path => "/etc/puppet/puppet.conf", |
21 |
ensure => present, |
22 |
owner => root, |
23 |
group => root, |
24 |
mode => 644, |
25 |
content => template("puppet/puppet.conf"), |
26 |
require => Package[puppet] |
27 |
} |
28 |
} |
29 |
|
30 |
class master inherits client { |
31 |
package { puppet-server: |
32 |
ensure => installed |
33 |
} |
34 |
|
35 |
# for stored config |
36 |
package { ["ruby-sqlite3","rails"]: |
37 |
ensure => installed |
38 |
} |
39 |
|
40 |
service { puppetmaster: |
41 |
ensure => running, |
42 |
path => "/etc/init.d/puppetmaster", |
43 |
subscribe => [ Package[puppet-server], File["puppet.conf"]] |
44 |
} |
45 |
|
46 |
file { "extdata": |
47 |
path => "/etc/puppet/extdata", |
48 |
ensure => directory, |
49 |
owner => puppet, |
50 |
group => puppet, |
51 |
mode => 700, |
52 |
recurse => true |
53 |
} |
54 |
|
55 |
file { '/etc/puppet/tagmail.conf': |
56 |
ensure => present, |
57 |
owner => root, |
58 |
group => root, |
59 |
mode => 644, |
60 |
content => template("puppet/tagmail.conf"), |
61 |
} |
62 |
|
63 |
tidy { "/var/lib/puppet/reports": |
64 |
age => "1m", |
65 |
matches => "*.yaml", |
66 |
recurse => true, |
67 |
type => "mtime", |
68 |
} |
69 |
|
70 |
} |
71 |
} |