From 618384cf08340b34a4eaf1022d200c1acb8161f4 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Wed, 19 Jan 2011 20:09:16 -0500 Subject: Support puppet client for FreeBSD Some pieces of the puzzle are missing for being able to manage puppet in FreeBSD. * Add a default puppet client config template for FreeBSD * In FreeBSD, puppet.conf is not in /etc/puppet/ so let's provide a value for this variable in init.pp. * The rc script for starting and stopping puppet is not located in /etc/rc.d so let's signify this to Service[puppet] Signed-off-by: Gabriel Filion --- files/client/puppet.conf.FreeBSD | 26 ++++++++++++++++++++++++++ manifests/freebsd.pp | 7 +++++++ manifests/init.pp | 7 +++++++ 3 files changed, 40 insertions(+) create mode 100644 files/client/puppet.conf.FreeBSD create mode 100644 manifests/freebsd.pp diff --git a/files/client/puppet.conf.FreeBSD b/files/client/puppet.conf.FreeBSD new file mode 100644 index 0000000..cd8bd2a --- /dev/null +++ b/files/client/puppet.conf.FreeBSD @@ -0,0 +1,26 @@ +[main] + logdir=/var/log/puppet + vardir=/var/puppet + rundir=/var/run/puppet + + ssldir=/usr/local/etc/puppet/ssl + + # Where 3rd party plugins and modules are installed + libdir = $vardir/lib + + templatedir=$vardir/templates + + # Turn plug-in synchronization on. + pluginsync = true + pluginsource = puppet://$server/plugins + factpath = $vardir/lib/facter + +[puppetd] + report=true + server=server.example.com + + # different run-interval, default= 30min + # e.g. run puppetd every 4 hours = 14400 + # runinterval = 14400 + + logdest=$logdir/puppet.log diff --git a/manifests/freebsd.pp b/manifests/freebsd.pp new file mode 100644 index 0000000..1fe28d0 --- /dev/null +++ b/manifests/freebsd.pp @@ -0,0 +1,7 @@ +class puppet::freebsd inherits puppet::base { + + Service['puppet'] { + path => '/usr/local/etc/rc.d', + } + +} diff --git a/manifests/init.pp b/manifests/init.pp index e9d9748..69d9b18 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -19,6 +19,13 @@ # class puppet { + $puppet_default_config = $kernel ? { + freebsd => '/usr/local/etc/puppet/puppet.conf', + default => '/etc/puppet/puppet.conf', + } + + if $puppet_config == '' { $puppet_config = $puppet_default_config } + case $kernel { linux: { case $operatingsystem { -- cgit v1.2.3