summaryrefslogtreecommitdiff
path: root/manifests/puppet.pp
blob: b783e99f9fbaec1a5392b2bae5faf329d5cf5cdb (plain)
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
34
35
36
37
38
39
40
41
# This classes manage a puppet installation, and provide for a puppetd
# service and a puppetmasterd service, the latter constantly updated by a
# cron-job which git-pushes from '/var/git/repositories/puppet.git'.

# guarantees puppet user, group and ownerships
class puppet {
  user { "puppet":
    ensure    => present,
    allowdupe => false,
  }

  group { "puppet":
    ensure    => present,
    allowdupe => false,
  }

  file { "/etc/puppet":
    ensure  => directory,
    owner   => puppet,
    group   => puppet,
    recurse => inf,
    require => User["puppet"],
  }

  file { "/usr/local/sbin/check-puppetd.sh":
    source => "puppet://$server/modules/puppet/check-puppetd.sh",
    owner  => "puppet",
    group  => "puppet",
    mode   => 0755,
    ensure => present,
  }

  cron { "puppetd-check":
    command  => "/usr/local/sbin/check-puppetd.sh &> /dev/null",
    user     => root,
    hour     => "*/1",
    minute   => "0",
    require  => File["/usr/local/sbin/check-puppetd.sh"],
    ensure   => present,
  }
}