From 7d904841c15873db9ac1745f659d8464fd45f41a Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 6 Aug 2010 19:36:40 +0200 Subject: codestyle - whitespace Only code style and whitespace formatting issues. Everything should no be in ligne. --- manifests/puppetmaster/base.pp | 52 +++++++++++++++----------------- manifests/puppetmaster/centos.pp | 16 +++++----- manifests/puppetmaster/checklastrun.pp | 22 +++++++------- manifests/puppetmaster/cluster.pp | 4 +-- manifests/puppetmaster/cluster/base.pp | 8 ++--- manifests/puppetmaster/debian.pp | 5 +-- manifests/puppetmaster/hasdb.pp | 26 ++++++++-------- manifests/puppetmaster/hasdb/mysql.pp | 46 ++++++++++++++-------------- manifests/puppetmaster/linux.pp | 35 ++++++++++----------- manifests/puppetmaster/package.pp | 10 +++--- manifests/puppetmaster/package/base.pp | 14 ++++----- manifests/puppetmaster/package/centos.pp | 10 +++--- manifests/puppetmaster/passenger.pp | 32 ++++++++------------ manifests/puppetmaster/storeconfigs.pp | 8 ++--- 14 files changed, 131 insertions(+), 157 deletions(-) (limited to 'manifests/puppetmaster') diff --git a/manifests/puppetmaster/base.pp b/manifests/puppetmaster/base.pp index b23e386..5eb2839 100644 --- a/manifests/puppetmaster/base.pp +++ b/manifests/puppetmaster/base.pp @@ -1,39 +1,37 @@ class puppet::puppetmaster::base inherits puppet::base { File[puppet_config]{ - source => [ "puppet://$server/modules/site-puppet/master/puppet.conf", - "puppet://$server/modules/puppet/master/puppet.conf" ], - notify => Service[puppetmaster], + source => [ "puppet://$server/modules/site-puppet/master/puppet.conf", + "puppet://$server/modules/puppet/master/puppet.conf" ], + notify => Service[puppetmaster], } - $real_puppet_fileserverconfig = $puppet_fileserverconfig ? { - '' => "/etc/puppet/fileserver.conf", - default => $puppet_fileserverconfig, - } + if !$puppet_fileserverconfig { $puppet_fileserverconfig = '/etc/puppet/fileserver.conf' } - file { "$real_puppet_fileserverconfig": - source => [ "puppet://$server/modules/site-puppet/master/${fqdn}/fileserver.conf", - "puppet://$server/modules/site-puppet/master/fileserver.conf", - "puppet://$server/modules/puppet/master/fileserver.conf" ], - notify => [Service[puppet],Service[puppetmaster] ], - owner => root, group => puppet, mode => 640; - } + file { "$puppet_fileserverconfig": + source => [ "puppet://$server/modules/site-puppet/master/${fqdn}/fileserver.conf", + "puppet://$server/modules/site-puppet/master/fileserver.conf", + "puppet://$server/modules/puppet/master/fileserver.conf" ], + notify => [ Service[puppet],Service[puppetmaster] ], + owner => root, group => puppet, mode => 640; + } - if $puppetmaster_storeconfigs { - include puppet::puppetmaster::storeconfigs - } + if $puppetmaster_storeconfigs { + include puppet::puppetmaster::storeconfigs + } - if ! defined (puppet::puppetmaster::passenger) { - # restart the master from time to time to avoid memory problems - file{'/etc/cron.d/puppetmaster.cron': + if ! defined (puppet::puppetmaster::passenger) { + # restart the master from time to time to avoid memory problems + file{'/etc/cron.d/puppetmaster.cron': source => [ "puppet://$server/modules/puppet/cron.d/puppetmaster.${operatingsystem}", - "puppet://$server/modules/puppet/cron.d/puppetmaster" ], + "puppet://$server/modules/puppet/cron.d/puppetmaster" ], owner => root, group => 0, mode => 0644; - } - } + } + } - file{'/etc/cron.daily/puppet_reports_cleanup.sh': - content => "#!/bin/bash\nfind /var/log/puppet/reports/ -maxdepth 2 -type f -ctime +30 -exec rm {} \\;\n", - owner => root, group => 0, mode => 0700; - } + # clean up reports older than 30 days + file{'/etc/cron.daily/puppet_reports_cleanup.sh': + content => "#!/bin/bash\nfind /var/log/puppet/reports/ -maxdepth 2 -type f -ctime +30 -exec rm {} \\;\n", + owner => root, group => 0, mode => 0700; + } } diff --git a/manifests/puppetmaster/centos.pp b/manifests/puppetmaster/centos.pp index 93a3a02..9a6cf91 100644 --- a/manifests/puppetmaster/centos.pp +++ b/manifests/puppetmaster/centos.pp @@ -1,12 +1,12 @@ # manifests/puppetmaster/centos.pp class puppet::puppetmaster::centos inherits puppet::puppetmaster::package { - file{'/etc/sysconfig/puppetmaster': - source => [ "puppet://$server/modules/site-puppet/sysconfig/${fqdn}/puppetmaster", - "puppet://$server/modules/site-puppet/sysconfig/${domain}/puppetmaster", - "puppet://$server/modules/site-puppet/sysconfig/puppetmaster", - "puppet://$server/modules/puppet/sysconfig/puppetmaster" ], - notify => Service[puppetmaster], - owner => root, group => 0, mode => 0644; - } + file{'/etc/sysconfig/puppetmaster': + source => [ "puppet://$server/modules/site-puppet/sysconfig/${fqdn}/puppetmaster", + "puppet://$server/modules/site-puppet/sysconfig/${domain}/puppetmaster", + "puppet://$server/modules/site-puppet/sysconfig/puppetmaster", + "puppet://$server/modules/puppet/sysconfig/puppetmaster" ], + notify => Service[puppetmaster], + owner => root, group => 0, mode => 0644; + } } diff --git a/manifests/puppetmaster/checklastrun.pp b/manifests/puppetmaster/checklastrun.pp index 0c0126d..0c3af5f 100644 --- a/manifests/puppetmaster/checklastrun.pp +++ b/manifests/puppetmaster/checklastrun.pp @@ -1,13 +1,13 @@ class puppet::puppetmaster::checklastrun { - file{"/usr/local/bin/puppetlast": - source => [ "puppet://$server/modules/site-puppet/master/puppetlast", - "puppet://$server/modules/puppet/master/puppetlast"], - owner => root, group => 0, mode => 0700; - } - file{'/etc/cron.d/puppetlast.cron': - content => "40 10,22 * * * root /usr/local/bin/puppetlast\n", - require => File["/usr/local/bin/puppetlast"], - owner => root, group => 0, mode => 0644, - notify => service["cron"]; - } + file{"/usr/local/bin/puppetlast": + source => [ "puppet://$server/modules/site-puppet/master/puppetlast", + "puppet://$server/modules/puppet/master/puppetlast" ], + owner => root, group => 0, mode => 0700; + } + file{'/etc/cron.d/puppetlast.cron': + content => "40 10,22 * * * root /usr/local/bin/puppetlast\n", + require => File["/usr/local/bin/puppetlast"], + owner => root, group => 0, mode => 0644, + notify => service["cron"]; + } } diff --git a/manifests/puppetmaster/cluster.pp b/manifests/puppetmaster/cluster.pp index 2242ba7..41298b3 100644 --- a/manifests/puppetmaster/cluster.pp +++ b/manifests/puppetmaster/cluster.pp @@ -1,5 +1,3 @@ -# manifests/puppetmaster/cluster.pp - class puppet::puppetmaster::cluster inherits puppet::puppetmaster { - include puppet::puppetmaster::cluster::base + include puppet::puppetmaster::cluster::base } diff --git a/manifests/puppetmaster/cluster/base.pp b/manifests/puppetmaster/cluster/base.pp index 759b0d2..1aa1f8b 100644 --- a/manifests/puppetmaster/cluster/base.pp +++ b/manifests/puppetmaster/cluster/base.pp @@ -1,8 +1,8 @@ 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] ], - } + File[puppet_config] { + require +> [ Package[mongrel], Package[nginx], File[nginx_config] ], + } } diff --git a/manifests/puppetmaster/debian.pp b/manifests/puppetmaster/debian.pp index bcbee9b..14ea3cc 100644 --- a/manifests/puppetmaster/debian.pp +++ b/manifests/puppetmaster/debian.pp @@ -1,4 +1 @@ -# manifests/puppetmaster/debian.pp - -class puppet::puppetmaster::debian inherits puppet::puppetmaster::package { -} +class puppet::puppetmaster::debian inherits puppet::puppetmaster::package { } diff --git a/manifests/puppetmaster/hasdb.pp b/manifests/puppetmaster/hasdb.pp index 82bbe47..1ba1331 100644 --- a/manifests/puppetmaster/hasdb.pp +++ b/manifests/puppetmaster/hasdb.pp @@ -1,19 +1,17 @@ define puppet::puppetmaster::hasdb( - $dbtype = 'mysql', - $dbname = 'puppet', - $dbhost = 'localhost', - # this is needed due to the collection of the databases - $dbhostfqdn = "${fqdn}", - $dbuser = 'puppet', - $dbpwd = $puppet_storeconfig_password, - $dbconnectinghost = 'locahost' + $dbtype = 'mysql', + $dbname = 'puppet', + $dbhost = 'localhost', + # this is needed due to the collection of the databases + $dbhostfqdn = "${fqdn}", + $dbuser = 'puppet', + $dbpwd = $puppet_storeconfig_password, + $dbconnectinghost = 'locahost' ){ - case $puppet_storeconfig_password { - '': { fail("No \$puppet_storeconfig_password is set, please set it in your manifests or site.pp to add a password") } - } + if !$puppet_storeconfig_password { fail("No \$puppet_storeconfig_password is set, please set it in your manifests or site.pp to add a password") } - case $dbtype { - 'mysql': { puppet::puppetmaster::hasdb::mysql{$name: dbname => $dbname, dbhost => $dbhost, dbuser => $dbuser, dbpwd => $dbpwd, } } - } + case $dbtype { + 'mysql': { puppet::puppetmaster::hasdb::mysql{$name: dbname => $dbname, dbhost => $dbhost, dbuser => $dbuser, dbpwd => $dbpwd, } } + } } diff --git a/manifests/puppetmaster/hasdb/mysql.pp b/manifests/puppetmaster/hasdb/mysql.pp index 51fd776..22e6434 100644 --- a/manifests/puppetmaster/hasdb/mysql.pp +++ b/manifests/puppetmaster/hasdb/mysql.pp @@ -1,31 +1,31 @@ # don't use this define use the general interface define puppet::puppetmaster::hasdb::mysql( - $dbname = 'puppet', - $dbhost = 'localhost', - $dbhostfqdn = "${fqdn}", - $dbuser = 'puppet', - $dbpwd, - $dbconnectinghost = 'localhost' + $dbname = 'puppet', + $dbhost = 'localhost', + $dbhostfqdn = "${fqdn}", + $dbuser = 'puppet', + $dbpwd, + $dbconnectinghost = 'localhost' ){ - @@mysql_database{$dbname: - tag => "mysql_${dbhostfqdn}", - } + @@mysql_database{$dbname: + tag => "mysql_${dbhostfqdn}", + } - @@mysql_user{"${dbuser}@${dbconnectinghost}": - password_hash => mysql_password("$dbpwd"), - require => Mysql_database[$dbname], - tag => "mysql_${dbhostfqdn}", - } + @@mysql_user{"${dbuser}@${dbconnectinghost}": + password_hash => mysql_password("$dbpwd"), + require => Mysql_database[$dbname], + tag => "mysql_${dbhostfqdn}", + } - @@mysql_grant{"${dbuser}@${dbconnectinghost}/${dbname}": - privileges => all, - require => Mysql_user["${dbuser}@${dbconnectinghost}"], - tag => "mysql_${dbhostfqdn}", - } + @@mysql_grant{"${dbuser}@${dbconnectinghost}/${dbname}": + privileges => all, + require => Mysql_user["${dbuser}@${dbconnectinghost}"], + tag => "mysql_${dbhostfqdn}", + } - munin::plugin::deploy{'puppetresources': - source => "puppet/munin/puppetresources.mysql", - config => "env.mysqlopts --user=$dbuser --password=$dbpwd -h $dbhost\nenv.puppetdb $dbname", - } + 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 2a71dd4..062d907 100644 --- a/manifests/puppetmaster/linux.pp +++ b/manifests/puppetmaster/linux.pp @@ -1,29 +1,26 @@ -# manifests/puppetmaster/linux.pp - class puppet::puppetmaster::linux inherits puppet::linux { - - if defined (puppet::puppetmaster::passenger) { - service{'puppetmaster': + + if defined (puppet::puppetmaster::passenger) { + service{'puppetmaster': ensure => running, - #name => apache2, + #name => apache2, #enable => true, - pattern => 'apache2', + pattern => 'apache2', hasstatus => true, - start => '/etc/init.d/apache2 start', + start => '/etc/init.d/apache2 start', stop => '/etc/init.d/apache2 start', restart => '/etc/init.d/apache2 restart', - status => 'pgrep apache2', + status => 'pgrep apache2', require => [ Package[puppet] ], - } - } - else { - service{'puppetmaster': + } + } else { + service{'puppetmaster': ensure => running, - enable => true, + enable => true, require => [ Package[puppet] ], - } - } - Service[puppet]{ - require +> Service[puppetmaster], - } + } + } + Service[puppet]{ + require +> Service[puppetmaster], + } } diff --git a/manifests/puppetmaster/package.pp b/manifests/puppetmaster/package.pp index c17c6f9..4be146d 100644 --- a/manifests/puppetmaster/package.pp +++ b/manifests/puppetmaster/package.pp @@ -1,10 +1,8 @@ # manifests/puppetmaster/package.pp class puppet::puppetmaster::package inherits puppet::puppetmaster::linux { - - case $operatingsystem { - centos: { include puppet::puppetmaster::package::centos } - default: { include puppet::puppetmaster::package::base } - } - + case $operatingsystem { + centos: { include puppet::puppetmaster::package::centos } + default: { include puppet::puppetmaster::package::base } + } } diff --git a/manifests/puppetmaster/package/base.pp b/manifests/puppetmaster/package/base.pp index 1eb9302..94f2c79 100644 --- a/manifests/puppetmaster/package/base.pp +++ b/manifests/puppetmaster/package/base.pp @@ -1,11 +1,9 @@ class puppet::puppetmaster::package::base inherits puppet::puppetmaster::package { + package{'puppetmaster': + ensure => present, + } - package { 'puppetmaster': - ensure => present, - } - - Service['puppetmaster']{ - require +> Package['puppetmaster'], - } - + Service['puppetmaster']{ + require +> Package['puppetmaster'], + } } diff --git a/manifests/puppetmaster/package/centos.pp b/manifests/puppetmaster/package/centos.pp index f6470ec..e3bb145 100644 --- a/manifests/puppetmaster/package/centos.pp +++ b/manifests/puppetmaster/package/centos.pp @@ -1,8 +1,6 @@ class puppet::puppetmaster::package::centos inherits puppet::puppetmaster::package::base { - - Package['puppetmaster'] { - name => 'puppet-server', - alias => 'puppetmaster', - } - + Package['puppetmaster']{ + name => 'puppet-server', + alias => 'puppetmaster', + } } diff --git a/manifests/puppetmaster/passenger.pp b/manifests/puppetmaster/passenger.pp index 244e2bb..375d364 100644 --- a/manifests/puppetmaster/passenger.pp +++ b/manifests/puppetmaster/passenger.pp @@ -2,26 +2,20 @@ class puppet::puppetmaster::passenger inherits puppet::puppetmaster::base { - include ::passenger + include ::passenger - # A reference configuration is available at : - # http://github.com/reductivelabs/puppet/tree/master/ext/rack + # A reference configuration is available at : + # http://github.com/reductivelabs/puppet/tree/master/ext/rack - file { ['/etc/puppet/rack', '/etc/puppet/rack/public']: - ensure => directory, - owner => root, - group => 0, - mode => 0755, - } - - file { "/etc/puppet/rack/config.ru": - ensure => present, - source => [ "puppet://${server}/modules/site-puppet/master/config.ru", - "puppet://${server}/modules/puppet/master/config.ru", - ], - owner => puppet, - group => 0, - mode => 0644, - } + file { ['/etc/puppet/rack', '/etc/puppet/rack/public']: + ensure => directory, + owner => root, group => 0, mode => 0755; + } + file {'/etc/puppet/rack/config.ru': + ensure => present, + source => [ "puppet://${server}/modules/site-puppet/master/config.ru", + "puppet://${server}/modules/puppet/master/config.ru" ], + owner => puppet, group => 0, mode => 0644; + } } diff --git a/manifests/puppetmaster/storeconfigs.pp b/manifests/puppetmaster/storeconfigs.pp index a3b09bd..63c1191 100644 --- a/manifests/puppetmaster/storeconfigs.pp +++ b/manifests/puppetmaster/storeconfigs.pp @@ -2,9 +2,7 @@ # so storeconfigs works. class puppet::puppetmaster::storeconfigs { - - include rails - include mysql::server - include mysql::client::ruby - + include rails + include mysql::server + include mysql::client::ruby } -- cgit v1.2.3