diff options
Diffstat (limited to 'manifests/init.pp')
-rw-r--r-- | manifests/init.pp | 122 |
1 files changed, 119 insertions, 3 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index b591518..2575121 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,9 +1,125 @@ -# modules/skeleton/manifests/init.pp - manage skeleton stuff +# modules/puppet/manifests/init.pp - manage puppet stuff # Copyright (C) 2007 admin@immerda.ch # -# modules_dir { "skeleton": } +# modules_dir { "puppet": } -class skeleton { +class puppet { + Package{'puppet': + name => 'puppet', + category => $operatingsystem ? { + gentoo: 'app-admin', + default => '', + }, + ensure => present, + } + + Package{'facter': + name => 'facter', + category => $operatingsystem ? { + gentoo: 'dev-ruby' + default => '', + }, + ensure => present, + } + + + Service{'puppet': + enable => true, + ensure => running, + require => Package[puppet], + } + + file {"$rubysitedir/puppet/parser/functions/": + ensure => directory, + owner => root, + group => 0, + mode => 744, + } + + file { 'slash_escape_function': + path => "$rubysitedir/puppet/parser/functions/slash_escape.rb", + ensure => file, + owner => 'root', + group => 0, + mode => 644, + source => "puppet://$server/puppet/improvements/functions/slash_escape.rb", + } + + file { 'puppet_patch_script': + path => "/root/puppet_install.sh", + ensure => absent, + } + + file { 'puppet_patch': + path => "/root/puppet_0.23.2-13.diff", + ensure => absent, + } + + file { 'puppet_patch2': + path => "/root/puppet_module_plugin_dirs.patch", + ensure => absent, + } +} + +class puppetmaster inherits puppet { + Service{'puppetmaster': + enable => true, + ensure => running, + require => Package[puppet], + } } + +puppet::config($source = ''){ + + $real_source = $source ? { + '' => 'puppet/client/puppet.conf' + default => $source, + } + + file { 'pupet_config': + path => '/etc/puppet/puppet.conf' + owner => root, + group => 0, + mode => 600, + source => $real_source, + notify => Service[puppet], + } +} + +puppet::masterconfig( + $puppetsource = '', + $fileserversource = '' +){ + + + $real_puppetsource = $puppetsource ? { + '' => 'puppet/master/puppet.conf' + default => $source, + } + + $real_fileserversource = $fileserversource ? { + '' => 'puppet/master/fileserver.conf' + default => $source, + } + + file { 'pupet_config': + path => '/etc/puppet/puppet.conf' + owner => root, + group => 0, + mode => 600, + source => $real_puppetsource, + notify => [Service[puppet],Service[puppetmaster], + } + file { 'fileserver_config': + path => '/etc/puppet/fileserver.conf' + owner => root, + group => 0, + mode => 600, + source => $real_fileserversource, + notify => [Service[puppet],Service[puppetmaster], + } +} + + |