summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2010-11-28 13:01:46 -0500
committerMicah Anderson <micah@riseup.net>2010-11-28 13:01:46 -0500
commit735572fac73a710321b2bc469be2cbdf17c46b11 (patch)
tree96b4c66216e132b7f1244456d074b4b69d01ba70
parentbec32391d6678a9f52f71658d98a2700ddd31f60 (diff)
Fix whitespace and coding standards to use standard formatting styles (I believe that this Closes #2353)
-rw-r--r--manifests/base.pp8
-rw-r--r--manifests/centos.pp3
-rw-r--r--manifests/cron/base.pp4
-rw-r--r--manifests/cron/linux.pp1
-rw-r--r--manifests/cron/openbsd.pp1
-rw-r--r--manifests/debian.pp4
-rw-r--r--manifests/gentoo.pp1
-rw-r--r--manifests/linux.pp2
-rw-r--r--manifests/openbsd.pp27
-rw-r--r--manifests/puppetmaster/base.pp1
-rw-r--r--manifests/puppetmaster/centos.pp4
-rw-r--r--manifests/puppetmaster/checklastrun.pp20
-rw-r--r--manifests/puppetmaster/checklastrun/disable.pp1
-rw-r--r--manifests/puppetmaster/cleanup_reports.pp3
-rw-r--r--manifests/puppetmaster/cleanup_reports/disable.pp1
-rw-r--r--manifests/puppetmaster/cluster.pp2
-rw-r--r--manifests/puppetmaster/cluster/base.pp3
-rw-r--r--manifests/puppetmaster/hasdb.pp6
-rw-r--r--manifests/puppetmaster/hasdb/mysql.pp15
-rw-r--r--manifests/puppetmaster/linux.pp14
-rw-r--r--manifests/puppetmaster/package/base.pp3
-rw-r--r--manifests/puppetmaster/package/centos.pp1
-rw-r--r--manifests/puppetmaster/passenger.pp16
23 files changed, 82 insertions, 59 deletions
diff --git a/manifests/base.pp b/manifests/base.pp
index 0a6e2f9..13f8c74 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -1,4 +1,5 @@
class puppet::base {
+
if !$puppet_config { $puppet_config = '/etc/puppet/puppet.conf' }
$puppet_majorversion = regsubst($puppetversion,'^(\d+\.\d+).*$','\1')
@@ -13,11 +14,12 @@ class puppet::base {
"puppet:///modules/puppet/client/puppet.conf.$operatingsystem",
"puppet:///modules/puppet/client/puppet.conf" ],
notify => Service[puppet],
- # if puppetmasterd is deployed by apache2/passenger it needs to read puppet.conf
- # therefore it must be readable by puppet
+ # if puppetmasterd is deployed by apache2/passenger it needs to read puppet.conf
+ # therefore it must be readable by puppet
owner => puppet, group => 0, mode => 600;
}
- service{'puppet':
+
+ service { 'puppet':
ensure => running,
enable => true,
hasstatus => true,
diff --git a/manifests/centos.pp b/manifests/centos.pp
index 6fdde9e..61aa065 100644
--- a/manifests/centos.pp
+++ b/manifests/centos.pp
@@ -1,5 +1,6 @@
class puppet::centos inherits puppet::linux {
- file{'/etc/sysconfig/puppet':
+
+ file { '/etc/sysconfig/puppet':
source => [ "puppet:///modules/site-puppet/sysconfig/${fqdn}/puppet",
"puppet:///modules/site-puppet/sysconfig/${domain}/puppet",
"puppet:///modules/site-puppet/sysconfig/puppet",
diff --git a/manifests/cron/base.pp b/manifests/cron/base.pp
index acef55e..7daa6fb 100644
--- a/manifests/cron/base.pp
+++ b/manifests/cron/base.pp
@@ -1,6 +1,6 @@
# manifests/cron/base.pp
-
class puppet::cron::base inherits puppet::base {
+
Service['puppet']{
enable => false,
}
@@ -21,7 +21,7 @@ class puppet::cron::base inherits puppet::base {
pattern => 'puppetd',
}
# this works only on < 2.6
- exec{'stop_puppet':
+ exec { 'stop_puppet':
command => 'kill `cat /var/run/puppet/puppetd.pid`',
onlyif => 'test -f /var/run/puppet/puppetd.pid',
require => Service['puppet'],
diff --git a/manifests/cron/linux.pp b/manifests/cron/linux.pp
index a5008bf..b3a10aa 100644
--- a/manifests/cron/linux.pp
+++ b/manifests/cron/linux.pp
@@ -1,5 +1,6 @@
# manifests/cron/linux.pp
class puppet::cron::linux inherits puppet::linux {
+
include puppet::cron::base
if !$puppet_config { $puppet_config = '/etc/puppet/puppet.conf' }
if $puppet_http_compression { $puppet_http_compression_str = '--http_compression' }
diff --git a/manifests/cron/openbsd.pp b/manifests/cron/openbsd.pp
index 4ee293f..084b022 100644
--- a/manifests/cron/openbsd.pp
+++ b/manifests/cron/openbsd.pp
@@ -1,4 +1,5 @@
class puppet::cron::openbsd inherits puppet::openbsd {
+
include puppet::cron::base
if !$puppet_config { $puppet_config = '/etc/puppet/puppet.conf' }
if $puppet_http_compression { $puppet_http_compression_str = '--http_compression' }
diff --git a/manifests/debian.pp b/manifests/debian.pp
index fba7beb..e046e27 100644
--- a/manifests/debian.pp
+++ b/manifests/debian.pp
@@ -1,5 +1,6 @@
class puppet::debian inherits puppet::linux {
- file{'/etc/default/puppet':
+
+ file { '/etc/default/puppet':
source => [ "puppet:///modules/site-puppet/client/debian/${fqdn}/puppet",
"puppet:///modules/site-puppet/client/debian/${domain}/puppet",
"puppet:///modules/site-puppet/client/debian/puppet",
@@ -12,6 +13,7 @@ class puppet::debian inherits puppet::linux {
Service[puppet]{
hasstatus => false,
}
+
File['/etc/cron.d/puppetd.cron']{
path => '/etc/cron.d/puppetd',
}
diff --git a/manifests/gentoo.pp b/manifests/gentoo.pp
index 1fed53d..da78226 100644
--- a/manifests/gentoo.pp
+++ b/manifests/gentoo.pp
@@ -1,4 +1,5 @@
class puppet::gentoo inherits puppet::linux {
+
Package[puppet]{
category => 'app-admin',
}
diff --git a/manifests/linux.pp b/manifests/linux.pp
index a217f66..b7a8142 100644
--- a/manifests/linux.pp
+++ b/manifests/linux.pp
@@ -16,7 +16,7 @@ class puppet::linux inherits puppet::base {
require => Package[puppet],
}
- file{'/etc/cron.d/puppetd.cron':
+ file { '/etc/cron.d/puppetd.cron':
source => [ "puppet:///modules/puppet/cron.d/puppetd.${operatingsystem}",
"puppet:///modules/puppet/cron.d/puppetd" ],
owner => root, group => 0, mode => 0644,
diff --git a/manifests/openbsd.pp b/manifests/openbsd.pp
index 1eeaba5..cff727e 100644
--- a/manifests/openbsd.pp
+++ b/manifests/openbsd.pp
@@ -1,7 +1,9 @@
class puppet::openbsd inherits puppet::base {
+
File['puppet_config']{
owner => '_puppet'
}
+
Service['puppet']{
restart => '/bin/kill -HUP `/bin/cat /var/run/puppet/agent.pid`',
stop => '/bin/kill `/bin/cat /var/run/puppet/agent.pid`',
@@ -10,18 +12,21 @@ class puppet::openbsd inherits puppet::base {
hasrestart => false,
pattern => 'puppet agent',
}
- openbsd::rc_local{'puppetd':
+
+ openbsd::rc_local { 'puppetd':
binary => '/usr/local/bin/puppet agent',
}
- cron { 'puppetd_check':
- command => '/bin/ps ax | /usr/bin/grep -v grep | /usr/bin/grep -q "puppet agent" || (sleep `echo $RANDOM/2000*60 | bc` && /usr/local/bin/puppet agent)',
- user => root,
- minute => 0,
- }
- cron { 'puppetd_restart':
- command => 'sleep `echo $RANDOM/2000*60 | bc` && /bin/kill `/bin/cat /var/run/puppet/agent.pid`; /usr/local/bin/puppet agent',
- minute => 0,
- hour => 22,
- monthday => '*/2',
+
+ cron {
+ 'puppetd_check':
+ command => '/bin/ps ax | /usr/bin/grep -v grep | /usr/bin/grep -q "puppet agent" || (sleep `echo $RANDOM/2000*60 | bc` && /usr/local/bin/puppet agent)',
+ user => root,
+ minute => 0;
+
+ 'puppetd_restart':
+ command => 'sleep `echo $RANDOM/2000*60 | bc` && /bin/kill `/bin/cat /var/run/puppet/agent.pid`; /usr/local/bin/puppet agent',
+ minute => 0,
+ hour => 22,
+ monthday => '*/2',
}
}
diff --git a/manifests/puppetmaster/base.pp b/manifests/puppetmaster/base.pp
index 6f9bdc7..6ac1e0c 100644
--- a/manifests/puppetmaster/base.pp
+++ b/manifests/puppetmaster/base.pp
@@ -1,4 +1,5 @@
class puppet::puppetmaster::base inherits puppet::base {
+
File[puppet_config]{
source => [ "puppet:///modules/site-puppet/master/puppet.conf",
"puppet:///modules/puppet/master/puppet.conf" ],
diff --git a/manifests/puppetmaster/centos.pp b/manifests/puppetmaster/centos.pp
index 0daa69b..2673a4d 100644
--- a/manifests/puppetmaster/centos.pp
+++ b/manifests/puppetmaster/centos.pp
@@ -1,7 +1,7 @@
# manifests/puppetmaster/centos.pp
-
class puppet::puppetmaster::centos inherits puppet::puppetmaster::package {
- file{'/etc/sysconfig/puppetmaster':
+
+ file { '/etc/sysconfig/puppetmaster':
source => [ "puppet:///modules/site-puppet/sysconfig/${fqdn}/puppetmaster",
"puppet:///modules/site-puppet/sysconfig/${domain}/puppetmaster",
"puppet:///modules/site-puppet/sysconfig/puppetmaster",
diff --git a/manifests/puppetmaster/checklastrun.pp b/manifests/puppetmaster/checklastrun.pp
index 1cf5311..685d6b4 100644
--- a/manifests/puppetmaster/checklastrun.pp
+++ b/manifests/puppetmaster/checklastrun.pp
@@ -1,12 +1,14 @@
class puppet::puppetmaster::checklastrun {
- file{"/usr/local/bin/puppetlast":
- source => [ "puppet:///modules/site-puppet/master/puppetlast",
- "puppet:///modules/puppet/master/puppetlast" ],
- owner => root, group => 0, mode => 0700;
- }
- file{'/etc/cron.d/puppetlast.cron':
- content => "${puppetmaster_checklastrun} root /usr/local/bin/puppetlast ${puppetmaster_checklastrun_timeout}\n",
- require => File["/usr/local/bin/puppetlast"],
- owner => root, group => 0, mode => 0644,
+
+ file {
+ '/usr/local/bin/puppetlast':
+ source => [ "puppet:///modules/site-puppet/master/puppetlast",
+ "puppet:///modules/puppet/master/puppetlast" ],
+ owner => root, group => 0, mode => 0700;
+
+ '/etc/cron.d/puppetlast.cron':
+ content => "${puppetmaster_checklastrun} root /usr/local/bin/puppetlast ${puppetmaster_checklastrun_timeout}\n",
+ require => File["/usr/local/bin/puppetlast"],
+ owner => root, group => 0, mode => 0644,
}
}
diff --git a/manifests/puppetmaster/checklastrun/disable.pp b/manifests/puppetmaster/checklastrun/disable.pp
index 47c0130..1ab4648 100644
--- a/manifests/puppetmaster/checklastrun/disable.pp
+++ b/manifests/puppetmaster/checklastrun/disable.pp
@@ -1,4 +1,5 @@
class puppet::puppetmaster::checklastrun::disable inherits puppet::puppetmaster::checklastrun {
+
File['/usr/local/bin/puppetlast']{
ensure => absent,
}
diff --git a/manifests/puppetmaster/cleanup_reports.pp b/manifests/puppetmaster/cleanup_reports.pp
index 4d76ceb..58fb9e2 100644
--- a/manifests/puppetmaster/cleanup_reports.pp
+++ b/manifests/puppetmaster/cleanup_reports.pp
@@ -1,6 +1,7 @@
class puppet::puppetmaster::cleanup_reports {
+
# clean up reports older than $puppetmaster_cleanup_reports days
- file{'/etc/cron.daily/puppet_reports_cleanup.sh':
+ file { '/etc/cron.daily/puppet_reports_cleanup.sh':
content => "#!/bin/bash\nfind /var/log/puppet/reports/ -maxdepth 2 -type f -ctime +${puppetmaster_cleanup_reports} -exec rm {} \\;\n",
owner => root, group => 0, mode => 0700;
}
diff --git a/manifests/puppetmaster/cleanup_reports/disable.pp b/manifests/puppetmaster/cleanup_reports/disable.pp
index f195a3e..8636223 100644
--- a/manifests/puppetmaster/cleanup_reports/disable.pp
+++ b/manifests/puppetmaster/cleanup_reports/disable.pp
@@ -1,4 +1,5 @@
class puppet::puppetmaster::cleanup_reports::disable inherits puppet::puppetmaster::cleanup_reports {
+
File['/etc/cron.daily/puppet_reports_cleanup.sh']{
ensure => absent,
}
diff --git a/manifests/puppetmaster/cluster.pp b/manifests/puppetmaster/cluster.pp
index 41298b3..8d635ab 100644
--- a/manifests/puppetmaster/cluster.pp
+++ b/manifests/puppetmaster/cluster.pp
@@ -1,3 +1,5 @@
class puppet::puppetmaster::cluster inherits puppet::puppetmaster {
+
include puppet::puppetmaster::cluster::base
+
}
diff --git a/manifests/puppetmaster/cluster/base.pp b/manifests/puppetmaster/cluster/base.pp
index 1aa1f8b..8c90153 100644
--- a/manifests/puppetmaster/cluster/base.pp
+++ b/manifests/puppetmaster/cluster/base.pp
@@ -1,6 +1,7 @@
class puppet::puppetmaster::cluster::base inherits puppet::puppetmaster::base {
- include mongrel, nginx
+ include mongrel, nginx
+
File[puppet_config] {
require +> [ Package[mongrel], Package[nginx], File[nginx_config] ],
}
diff --git a/manifests/puppetmaster/hasdb.pp b/manifests/puppetmaster/hasdb.pp
index 1ba1331..2aca0e6 100644
--- a/manifests/puppetmaster/hasdb.pp
+++ b/manifests/puppetmaster/hasdb.pp
@@ -1,4 +1,4 @@
-define puppet::puppetmaster::hasdb(
+define puppet::puppetmaster::hasdb (
$dbtype = 'mysql',
$dbname = 'puppet',
$dbhost = 'localhost',
@@ -6,8 +6,8 @@ define puppet::puppetmaster::hasdb(
$dbhostfqdn = "${fqdn}",
$dbuser = 'puppet',
$dbpwd = $puppet_storeconfig_password,
- $dbconnectinghost = 'locahost'
-){
+ $dbconnectinghost = 'locahost' )
+{
if !$puppet_storeconfig_password { fail("No \$puppet_storeconfig_password is set, please set it in your manifests or site.pp to add a password") }
diff --git a/manifests/puppetmaster/hasdb/mysql.pp b/manifests/puppetmaster/hasdb/mysql.pp
index 22e6434..322bf69 100644
--- a/manifests/puppetmaster/hasdb/mysql.pp
+++ b/manifests/puppetmaster/hasdb/mysql.pp
@@ -1,30 +1,29 @@
# don't use this define use the general interface
-define puppet::puppetmaster::hasdb::mysql(
+define puppet::puppetmaster::hasdb::mysql (
$dbname = 'puppet',
$dbhost = 'localhost',
$dbhostfqdn = "${fqdn}",
$dbuser = 'puppet',
$dbpwd,
- $dbconnectinghost = 'localhost'
-){
- @@mysql_database{$dbname:
+ $dbconnectinghost = 'localhost' )
+{
+ @@mysql_database { $dbname:
tag => "mysql_${dbhostfqdn}",
}
- @@mysql_user{"${dbuser}@${dbconnectinghost}":
+ @@mysql_user { "${dbuser}@${dbconnectinghost}":
password_hash => mysql_password("$dbpwd"),
require => Mysql_database[$dbname],
tag => "mysql_${dbhostfqdn}",
}
-
- @@mysql_grant{"${dbuser}@${dbconnectinghost}/${dbname}":
+ @@mysql_grant { "${dbuser}@${dbconnectinghost}/${dbname}":
privileges => all,
require => Mysql_user["${dbuser}@${dbconnectinghost}"],
tag => "mysql_${dbhostfqdn}",
}
- munin::plugin::deploy{'puppetresources':
+ munin::plugin::deploy { 'puppetresources':
source => "puppet/munin/puppetresources.mysql",
config => "env.mysqlopts --user=$dbuser --password=$dbpwd -h $dbhost\nenv.puppetdb $dbname",
}
diff --git a/manifests/puppetmaster/linux.pp b/manifests/puppetmaster/linux.pp
index 3d36f75..2670203 100644
--- a/manifests/puppetmaster/linux.pp
+++ b/manifests/puppetmaster/linux.pp
@@ -1,16 +1,16 @@
class puppet::puppetmaster::linux inherits puppet::linux {
if $puppetmaster_mode == 'passenger' {
- exec{'notify_passenger_puppetmaster':
+ exec { 'notify_passenger_puppetmaster':
refreshonly => true,
command => 'touch /etc/puppet/rack/tmp/restart.txt && sleep 1 && rm /etc/puppet/rack/tmp/restart.txt',
- }
+ }
} else {
- service{'puppetmaster':
- ensure => running,
- enable => true,
- require => [ Package[puppet] ],
- }
+ service { 'puppetmaster':
+ ensure => running,
+ enable => true,
+ require => [ Package[puppet] ],
+ }
}
Service[puppet]{
require +> Service[puppetmaster],
diff --git a/manifests/puppetmaster/package/base.pp b/manifests/puppetmaster/package/base.pp
index 94f2c79..363f827 100644
--- a/manifests/puppetmaster/package/base.pp
+++ b/manifests/puppetmaster/package/base.pp
@@ -1,5 +1,6 @@
class puppet::puppetmaster::package::base inherits puppet::puppetmaster::package {
- package{'puppetmaster':
+
+ package { 'puppetmaster':
ensure => present,
}
diff --git a/manifests/puppetmaster/package/centos.pp b/manifests/puppetmaster/package/centos.pp
index e3bb145..43361fd 100644
--- a/manifests/puppetmaster/package/centos.pp
+++ b/manifests/puppetmaster/package/centos.pp
@@ -1,4 +1,5 @@
class puppet::puppetmaster::package::centos inherits puppet::puppetmaster::package::base {
+
Package['puppetmaster']{
name => 'puppet-server',
alias => 'puppetmaster',
diff --git a/manifests/puppetmaster/passenger.pp b/manifests/puppetmaster/passenger.pp
index f7fa3ab..c4bc062 100644
--- a/manifests/puppetmaster/passenger.pp
+++ b/manifests/puppetmaster/passenger.pp
@@ -7,14 +7,14 @@ class puppet::puppetmaster::passenger inherits puppet::puppetmaster::base {
# A reference configuration is available at :
# http://github.com/reductivelabs/puppet/tree/master/ext/rack
- file { ['/etc/puppet/rack', '/etc/puppet/rack/public', '/etc/puppet/rack/tmp']:
- ensure => directory,
- owner => root, group => 0, mode => 0755;
- }
+ file {
+ ['/etc/puppet/rack', '/etc/puppet/rack/public', '/etc/puppet/rack/tmp']:
+ ensure => directory,
+ owner => root, group => 0, mode => 0755;
- file {'/etc/puppet/rack/config.ru':
- source => [ "puppet:///modules/site-puppet/master/config.ru",
- "puppet:///modules/puppet/master/config.ru" ],
- owner => puppet, group => 0, mode => 0644;
+ '/etc/puppet/rack/config.ru':
+ source => [ "puppet:///modules/site-puppet/master/config.ru",
+ "puppet:///modules/puppet/master/config.ru" ],
+ owner => puppet, group => 0, mode => 0644;
}
}