Initial version of puppet module.
This commit is contained in:
commit
56ee9b1bd6
2 changed files with 101 additions and 0 deletions
59
puppet/manifests/init.pp
Normal file
59
puppet/manifests/init.pp
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
|
||||||
|
class puppet::client {
|
||||||
|
|
||||||
|
case $operatingsystem {
|
||||||
|
OpenBSD: { $vardir = "/var/puppet" }
|
||||||
|
default: { $vardir = "/var/lib/puppet" }
|
||||||
|
}
|
||||||
|
|
||||||
|
case $operatingsystem {
|
||||||
|
centos,fedora: {
|
||||||
|
package { "ruby-shadow":
|
||||||
|
ensure => installed,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
package { "puppet":
|
||||||
|
name => $operatingsystem ? {
|
||||||
|
OpenBSD => "ruby-puppet",
|
||||||
|
default => "puppet",
|
||||||
|
},
|
||||||
|
ensure => present,
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "/etc/puppet/puppet.conf":
|
||||||
|
ensure => present,
|
||||||
|
content => template("puppet/puppet.conf.erb"),
|
||||||
|
mode => 0600,
|
||||||
|
owner => root,
|
||||||
|
group => $operatingsystem ? {
|
||||||
|
OpenBSD => wheel,
|
||||||
|
default => root
|
||||||
|
},
|
||||||
|
require => Package["puppet"],
|
||||||
|
notify => Service["puppet"],
|
||||||
|
}
|
||||||
|
|
||||||
|
service { "puppet":
|
||||||
|
ensure => running,
|
||||||
|
enable => true,
|
||||||
|
require => Package["puppet"],
|
||||||
|
}
|
||||||
|
|
||||||
|
case $operatingsystem {
|
||||||
|
OpenBSD: {
|
||||||
|
Service["puppet"] {
|
||||||
|
binary => "/usr/local/bin/puppetd",
|
||||||
|
start => "/usr/local/bin/puppetd",
|
||||||
|
pattern => puppetd,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
Service["puppet"] {
|
||||||
|
hasrestart => true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
42
puppet/templates/puppet.conf.erb
Normal file
42
puppet/templates/puppet.conf.erb
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
[main]
|
||||||
|
# Where Puppet stores dynamic and growing data.
|
||||||
|
# The default value is '/var/puppet'.
|
||||||
|
vardir = <%= vardir %>
|
||||||
|
|
||||||
|
<% if kernel == 'Linux' -%>
|
||||||
|
# The Puppet log directory.
|
||||||
|
# The default value is '$vardir/log'.
|
||||||
|
logdir = /var/log/puppet
|
||||||
|
|
||||||
|
# Where Puppet PID files are kept.
|
||||||
|
# The default value is '$vardir/run'.
|
||||||
|
rundir = /var/run/puppet
|
||||||
|
|
||||||
|
# Where SSL certificates are kept.
|
||||||
|
# The default value is '$confdir/ssl'.
|
||||||
|
ssldir = $vardir/ssl
|
||||||
|
|
||||||
|
<% end -%>
|
||||||
|
# Enable sending reports to puppet server.
|
||||||
|
report = true
|
||||||
|
|
||||||
|
# Enable sync of plugins and facts
|
||||||
|
pluginsync = true
|
||||||
|
pluginsignore = .svn CVS RCS
|
||||||
|
factpath = $vardir/lib/facter
|
||||||
|
|
||||||
|
[puppetd]
|
||||||
|
# The file in which puppetd stores a list of the classes
|
||||||
|
# associated with the retrieved configuratiion. Can be loaded in
|
||||||
|
# the separate ``puppet`` executable using the ``--loadclasses``
|
||||||
|
# option.
|
||||||
|
# The default value is '$confdir/classes.txt'.
|
||||||
|
classfile = $vardir/classes.txt
|
||||||
|
|
||||||
|
# Where puppetd caches the local configuration. An
|
||||||
|
# extension indicating the cache format is added automatically.
|
||||||
|
# The default value is '$confdir/localconfig'.
|
||||||
|
localconfig = $vardir/localconfig
|
||||||
|
|
||||||
|
# Enable dot graphs of configuration depencies
|
||||||
|
graph = true
|
Loading…
Add table
Reference in a new issue