initial
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 82
|
||||
/dav/ikwadmin/!svn/ver/4425/linux/puppetmaster/etc_puppet/modules/puppet/manifests
|
||||
END
|
||||
init.pp
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 90
|
||||
/dav/ikwadmin/!svn/ver/4425/linux/puppetmaster/etc_puppet/modules/puppet/manifests/init.pp
|
||||
END
|
||||
@@ -1,65 +0,0 @@
|
||||
10
|
||||
|
||||
dir
|
||||
4547
|
||||
https://uwaechte@svn.ikw.uni-osnabrueck.de/dav/ikwadmin/linux/puppetmaster/etc_puppet/modules/puppet/manifests
|
||||
https://uwaechte@svn.ikw.uni-osnabrueck.de/dav/ikwadmin
|
||||
|
||||
|
||||
|
||||
2011-06-17T11:42:17.274278Z
|
||||
4425
|
||||
uwaechte
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
0e4a7186-e024-0410-a49b-aced43e0d94e
|
||||
|
||||
init.pp
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2011-07-25T16:18:40.000000Z
|
||||
d51edba0f5f29a336fd11da809c6400b
|
||||
2011-06-17T11:42:17.274278Z
|
||||
4425
|
||||
uwaechte
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
5559
|
||||
|
||||
defines
|
||||
dir
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
K 12
|
||||
svn:keywords
|
||||
V 2
|
||||
Id
|
||||
END
|
||||
@@ -1,208 +0,0 @@
|
||||
# $Id$
|
||||
|
||||
class puppet ($ensure="present",
|
||||
$norunifloggedin=false,
|
||||
$daemonize=true,
|
||||
$run_hour="*/1",
|
||||
$run_minute="10"
|
||||
){
|
||||
|
||||
$puppet_service = $kernel ? {
|
||||
"Darwin" => "org.macports.puppet",
|
||||
"FreeBSD" => "puppetd",
|
||||
default => "puppet"
|
||||
}
|
||||
$factpath="/var/lib/puppet/lib/facter"
|
||||
case $kernel {
|
||||
"Linux": {
|
||||
$puppetpkgs = ["puppet","puppet-common"]
|
||||
Package { provider => "apt" }
|
||||
#Package["puppet-common"]{ before => Package["puppet"] }
|
||||
}
|
||||
default: {
|
||||
$puppetpkgs = "puppet"
|
||||
}
|
||||
}
|
||||
$puppet_linuxversion_real = $PUPPET_VERSION_LINUX ? {
|
||||
"" => "latest",
|
||||
default => $PUPPET_VERSION_LINUX,
|
||||
}
|
||||
# case $kernel {
|
||||
# "Linux": {
|
||||
# exec{"apt-get install -y puppet=$PUPPET_VERSION_LINUX puppet-common=${PUPPET_VERSION_LINUX}":
|
||||
# onlyif => "apt-show-versions -a puppet |tail -1 |grep -q upgradeable",
|
||||
# }
|
||||
# }
|
||||
# default: {
|
||||
package{$puppetpkgs:
|
||||
ensure => $ensure ? {
|
||||
"present" => $kernel ? {
|
||||
"Linux" => $puppet_linuxversion_real,
|
||||
default => $ensure,
|
||||
}
|
||||
},
|
||||
notify => Service["${puppet_service}"],
|
||||
}
|
||||
# }
|
||||
# }
|
||||
|
||||
package{["facter"]: ensure => "${ensure}", }
|
||||
|
||||
|
||||
service { "${puppet_service}":
|
||||
hasstatus => true,
|
||||
enable => "${daemonize}",
|
||||
ensure => "${daemonize}",
|
||||
}
|
||||
|
||||
$cron_real = $daemonize ? {
|
||||
false => "present",
|
||||
true => "absent",
|
||||
default => $ensure,
|
||||
}
|
||||
|
||||
notice("${fqdn} PUPPET-CRON: cron_real: ${cron_real}, daemonize: ${daemonize}, running: ${service_running}")
|
||||
cron { puppetrun:
|
||||
command => "/usr/local/sbin/puppetd_run.sh",
|
||||
user => root,
|
||||
minute => $run_minute,
|
||||
hour => $run_hour,
|
||||
ensure => "${cron_real}",
|
||||
}
|
||||
$maxsleep = 6400
|
||||
file{"/usr/local/sbin/puppetd_run.sh":
|
||||
content => template("puppet/puppetd_run.sh.erb"),
|
||||
mode => 0700,
|
||||
alias => "puppetd_run.sh",
|
||||
ensure => "${ensure}",
|
||||
}
|
||||
case $kernel {
|
||||
"Darwin": {
|
||||
file{"/Library/LaunchDaemons/org.macports.puppet.plist":
|
||||
source => "puppet:///modules/puppet/org.macports.puppet.plist",
|
||||
before => Service["${puppet_service}"],
|
||||
}
|
||||
file{"/opt/local/lib/ruby/site_ruby/1.8/puppet/provider/package/appdmg.rb":
|
||||
ensure => "absent",
|
||||
}
|
||||
}
|
||||
"Linux": {
|
||||
replace {"enable_puppet":
|
||||
file => "/etc/default/puppet",
|
||||
pattern => "START=no",
|
||||
replacement => "START=yes",
|
||||
before => Service["${puppet_service}"],
|
||||
}
|
||||
monit::process{"puppet":
|
||||
start => "/etc/init.d/puppet start",
|
||||
stop => "/etc/init.d/puppet stop",
|
||||
pidfile => "/var/run/puppet/agent.pid",
|
||||
additional => "if totalmem > 400 Mb for 10 cycles then RESTART",
|
||||
ensure => $daemonize ? {
|
||||
"true" => "present",
|
||||
default => "absent",
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$puppet_user = $operatingsystem ? {
|
||||
"Darwin" => $adm,
|
||||
default => "puppet",
|
||||
}
|
||||
$puppet_group = $operatingsystem ? {
|
||||
"Darwin" => "wheel",
|
||||
default => "puppet",
|
||||
}
|
||||
#"FreeBSD" => "/usr/local/etc/puppet/puppet.conf",
|
||||
$puppetconf = $operatingsystem ? {
|
||||
default => "/etc/puppet/puppet.conf",
|
||||
}
|
||||
|
||||
file{$puppetconf:
|
||||
content => template("puppet/puppet.conf.erb"),
|
||||
mode => 0644,
|
||||
owner => $puppet_user,
|
||||
ensure => "${ensure}",
|
||||
# require => [ Package["puppet"] ],
|
||||
}
|
||||
|
||||
#add facter variable to custom facts.
|
||||
file{"/etc/profile.d/puppet.sh":
|
||||
content => "export FACTERLIB=\"${factpath}\"\n",
|
||||
ensure => $ensure,
|
||||
}
|
||||
}
|
||||
|
||||
@@puppet::puppetmaster::privatedir{ $fqdn :
|
||||
l_fqdn => generate('/usr/bin/env', 'perl', '-e', '$_=shift;tr/[A-Z]/[a-z]/;print $_',"$fqdn")
|
||||
}
|
||||
|
||||
class puppet::puppet-dashboard ($ensure="present") {
|
||||
|
||||
package{["libjson-ruby","puppet-dashboard"]:
|
||||
ensure => $ensure,
|
||||
require => Apt::Repository["puppet-dashboard"],
|
||||
}
|
||||
apt::repository{"puppet-dashboard":
|
||||
key => "8347A27F",
|
||||
repository => "deb http://apt.puppetlabs.com/ubuntu lucid main\ndeb-src http://apt.puppetlabs.com/ubuntu lucid main\n",
|
||||
ensure => $ensure,
|
||||
}
|
||||
cron {"purge-reports":
|
||||
command => "cd /usr/share/puppet-dashboard && rake RAILS_ENV=production reports:prune upto=14 unit=day",
|
||||
user => "www-data",
|
||||
hour => "23",
|
||||
minute => "2",
|
||||
monthday => "*/14",
|
||||
ensure => $ensure,
|
||||
}
|
||||
|
||||
cron {"purge-optimizedb":
|
||||
command => "cd /usr/share/puppet-dashboard && rake RAILS_ENV=production db:raw:optimize",
|
||||
user => "www-data",
|
||||
hour => "23",
|
||||
minute => "20",
|
||||
monthday => "*/10",
|
||||
ensure => $ensure,
|
||||
}
|
||||
}
|
||||
|
||||
class puppet::puppetmaster ($ensure="present") {
|
||||
class{"activemq": ensure => $ensure }
|
||||
|
||||
package{"libnet-arp-perl": ensure => $ensure }
|
||||
Ganglia::Gmetric::Cron {
|
||||
source => "puppet/ganglia",
|
||||
ensure => "${ensure}",
|
||||
}
|
||||
ganglia::gmetric::cron{"puppetmaster.rb":
|
||||
runwhen => "5",
|
||||
}
|
||||
ganglia::gmetric::cron{"puppetmaster_compiletime.rb":
|
||||
runwhen => "60",
|
||||
}
|
||||
|
||||
service{"stompserver":
|
||||
ensure => false,
|
||||
enable => false,
|
||||
before => Class["activemq"],
|
||||
}
|
||||
service{"puppetqd":
|
||||
ensure => running,
|
||||
pattern => "puppet queue queue",
|
||||
enable => true,
|
||||
}
|
||||
### remove disk reports from time to time
|
||||
tidy{"${puppet_vardir}/reports":
|
||||
age => "1d",
|
||||
recurse => true,
|
||||
backup => false,
|
||||
}
|
||||
|
||||
# create [private] directories
|
||||
file { $puppet_privdir: ensure => directory }
|
||||
Puppet::Puppetmaster::Privatedir <<| |>>
|
||||
}
|
||||
|
||||
import "defines/*.pp"
|
||||
@@ -1,17 +0,0 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 90
|
||||
/dav/ikwadmin/!svn/ver/3493/linux/puppetmaster/etc_puppet/modules/puppet/manifests/defines
|
||||
END
|
||||
env_fact.pp
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 102
|
||||
/dav/ikwadmin/!svn/ver/2479/linux/puppetmaster/etc_puppet/modules/puppet/manifests/defines/env_fact.pp
|
||||
END
|
||||
private_dirs.pp
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 106
|
||||
/dav/ikwadmin/!svn/ver/3493/linux/puppetmaster/etc_puppet/modules/puppet/manifests/defines/private_dirs.pp
|
||||
END
|
||||
@@ -1,96 +0,0 @@
|
||||
10
|
||||
|
||||
dir
|
||||
4547
|
||||
https://uwaechte@svn.ikw.uni-osnabrueck.de/dav/ikwadmin/linux/puppetmaster/etc_puppet/modules/puppet/manifests/defines
|
||||
https://uwaechte@svn.ikw.uni-osnabrueck.de/dav/ikwadmin
|
||||
|
||||
|
||||
|
||||
2010-06-22T13:03:34.092649Z
|
||||
3493
|
||||
tkundoch
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
0e4a7186-e024-0410-a49b-aced43e0d94e
|
||||
|
||||
env_fact.pp
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2011-07-25T16:18:40.000000Z
|
||||
e4084d688182441c58989585a7e1be7d
|
||||
2009-05-16T12:02:33.150252Z
|
||||
2479
|
||||
uwaechte
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
745
|
||||
|
||||
private_dirs.pp
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2011-07-25T16:18:40.000000Z
|
||||
efa07844976a4dd05c4c2b1638ff557f
|
||||
2010-06-22T13:03:34.092649Z
|
||||
3493
|
||||
tkundoch
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
737
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
K 12
|
||||
svn:keywords
|
||||
V 2
|
||||
Id
|
||||
END
|
||||
@@ -1,5 +0,0 @@
|
||||
K 12
|
||||
svn:keywords
|
||||
V 2
|
||||
Id
|
||||
END
|
||||
@@ -1,27 +0,0 @@
|
||||
# $Id$
|
||||
|
||||
define puppet::env_fact(
|
||||
$factname="",
|
||||
$value,
|
||||
$ensure="present"
|
||||
){
|
||||
$factname_real = $factname ? {
|
||||
"" => upcase($name),
|
||||
default => upcase($factname)
|
||||
}
|
||||
if defined(Exec["create-env_fact.sh"]){
|
||||
debug("already defined.")
|
||||
}else{
|
||||
exec{"create-env_fact.sh":
|
||||
command => "echo \"#/bin/sh\n\" >>/etc/profile.d/env_facts.sh && chmod a+xr /etc/profile.d/env_facts.sh",
|
||||
onlyif => "test ! -e /etc/profile.d/env_facts.sh",
|
||||
before => Line["env_fact-${factname_real}"],
|
||||
}
|
||||
}
|
||||
|
||||
line{"env_fact-${factname_real}":
|
||||
line => "export FACTER_${factname_real}=${value}",
|
||||
file => "/etc/profile.d/env_facts.sh",
|
||||
ensure => $ensure,
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
##########################################################################
|
||||
## define puppet::puppetmaster::privatedir
|
||||
## $l_fqdn : hostname - lower case letters only
|
||||
## $title : hostname - as given in hosts client-cert
|
||||
##
|
||||
## $puppet_privdir (declared in site.pp) must already exist!
|
||||
|
||||
define puppet::puppetmaster::privatedir ( $l_fqdn ) {
|
||||
file { "${puppet_privdir}/${l_fqdn}":
|
||||
ensure => directory,
|
||||
owner => puppet
|
||||
} # file
|
||||
## create link if cert-hostname and DNS-provided fqdn differ
|
||||
if $title != $l_fqdn {
|
||||
file { "${puppet_privdir}/${title}":
|
||||
ensure => "${puppet_privdir}/${l_fqdn}",
|
||||
require => File["${puppet_privdir}/${l_fqdn}"]
|
||||
} # file
|
||||
} # if
|
||||
|
||||
} # define puppet::puppetmaster::privatedir
|
||||
Reference in New Issue
Block a user