From e59aec0fadd435cff42dceeb147d4eb85fdc9484 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 13 Jun 2012 21:23:36 -0300 Subject: take hiera out of the params --- manifests/cron.pp | 30 +++++++++++++++++++----------- manifests/init.pp | 24 ++++++++++++++++-------- manifests/master.pp | 41 ++++++++++++++++++++++++----------------- manifests/master/hasdb.pp | 4 ++-- manifests/master/hasdb/mysql.pp | 2 +- 5 files changed, 62 insertions(+), 39 deletions(-) (limited to 'manifests') diff --git a/manifests/cron.pp b/manifests/cron.pp index f8e9beb..ffb8032 100644 --- a/manifests/cron.pp +++ b/manifests/cron.pp @@ -1,18 +1,26 @@ class puppet::cron( $cron_time, - $stop_service = hiera('puppet_stop_service',true), - $config = hiera('puppet_config','/etc/puppet/puppet.conf'), - $http_compression = hiera('puppet_http_compression',false), - $cleanup_clientbucket = hiera('puppet_cleanup_clientbucket',false), - $ensure_version = hiera('puppet_ensure_version', 'installed'), - $ensure_facter_version = hiera('puppet_ensure_facter_version', 'installed'), + $stop_service = true, + $config = '/etc/puppet/puppet.conf', + $http_compression = 'puppet_http_compression', + $cleanup_clientbucket = false, + $ensure_version = 'installed', + $ensure_facter_version = 'installed', + $manage_shorewall = false, + $puppetmaster = "puppet.${domain}", + $puppetmaster_port = '8140', + $puppetmaster_signport = '8141' ) { class{'puppet': - config => $config, - http_compression => $http_compression, - cleanup_clientbucket => $cleanup_clientbucket, - ensure_version => $ensure_version, - ensure_facter_version => $ensure_facter_version + config => $config, + http_compression => $http_compression, + cleanup_clientbucket => $cleanup_clientbucket, + ensure_version => $ensure_version, + ensure_facter_version => $ensure_facter_version, + manage_shorewall => $manage_shorewall, + puppetmaster => $puppetmaster, + puppetmaster_port => $puppetmaster_port, + puppetmaster_signport => $puppetmaster_signport, } case $::operatingsystem { debian: { include puppet::cron::debian } diff --git a/manifests/init.pp b/manifests/init.pp index d6f605c..407ace1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -19,12 +19,16 @@ # class puppet( - $config = hiera('puppet_config','/etc/puppet/puppet.conf'), - $http_compression = hiera('puppet_http_compression',false), - $cleanup_clientbucket = hiera('puppet_cleanup_clientbucket',false), - $ensure_version = hiera('puppet_ensure_version', 'installed'), - $ensure_facter_version = hiera('puppet_ensure_facter_version', 'installed'), -) { + $config = '/etc/puppet/puppet.conf', + $http_compression = false, + $cleanup_clientbucket = false, + $ensure_version = 'installed', + $ensure_facter_version = 'installed', + $manage_shorewall = false, + $puppetmaster = "puppet.${::domain}", + $puppetserver_port = 8140, + $puppetserver_signport = 8141 +){ case $::kernel { linux: { case $::operatingsystem { @@ -38,7 +42,11 @@ class puppet( default: { include puppet::base } } - if hiera('use_shorewall',false) { - include shorewall::rules::out::puppet + if $manage_shorewall { + class{'shorewall::rules::out::puppet': + puppetserver => $puppetserver, + puppetserver_port => $puppetserver_port, + puppetserver_signport => $puppetserver_signport, + } } } diff --git a/manifests/master.pp b/manifests/master.pp index 2e3029f..7209778 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -1,19 +1,20 @@ # manifests/puppetmaster.pp class puppet::master( - $config = hiera('puppet_config','/etc/puppet/puppet.conf'), - $fileserver = hiera('puppet_fileserver_config','/etc/puppet/fileserver.conf'), - $http_compression = hiera('puppet_http_compression',false), - $cleanup_clientbucket = hiera('puppet_cleanup_clientbucket',false), - $cron_time = hiera('puppet_cron_time',false), - $ensure_version = hiera('puppet_ensure_version', 'installed'), - $ensure_facter_version = hiera('puppet_ensure_facter_version', 'installed'), - $lastruncheck_cron = hiera('puppet_master_lastruncheck_cron','40 10 * * *'), - $lastruncheck_ignorehosts = hiera('puppet_master_lastruncheck_ignorehosts',''), - $lastruncheck_timeout = hiera('puppet_master_lastruncheck_timeout',''), - $lastruncheck_additionaloptions = hiera('puppet_master_lastruncheck_additionaloptions',''), - $mode = hiera('puppet_master_mode','webrick'), - $cleanup_reports = hiera('puppet_master_cleanup_reports','30'), - $reports_dir = hiera('puppet_master_reports_dir','/var/lib/puppet/reports'), + $config = '/etc/puppet/puppet.conf', + $fileserver = '/etc/puppet/fileserver.conf', + $http_compression = false, + $cleanup_clientbucket = false, + $cron_time = false, + $ensure_version = 'installed', + $ensure_facter_version = 'installed', + $lastruncheck_cron = '40 10 * * *', + $lastruncheck_ignorehosts = '', + $lastruncheck_timeout = '', + $lastruncheck_additionaloptions = '', + $mode = 'webrick', + $cleanup_reports = '30', + $reports_dir = '/var/lib/puppet/reports', + $manage_shorewall = false ) { if $cron_time { class{'puppet::cron': @@ -23,6 +24,7 @@ class puppet::master( cron_time => $cron_time, ensure_version => $ensure_version, ensure_facter_version => $ensure_facter_version, + manage_shorewall => $manage_shorewall, } } else { class{'puppet': @@ -31,6 +33,7 @@ class puppet::master( cleanup_clientbucket => $cleanup_clientbucket, ensure_version => $ensure_version, ensure_facter_version => $ensure_facter_version, + manage_shorewall => $manage_shorewall, } } case $::operatingsystem { @@ -64,11 +67,15 @@ class puppet::master( include puppet::master::cleanup_reports::disable } - if hiera('use_shorewall',false) { - include shorewall::rules::puppet::master + if $manage_shorewall { + class{'shorewall::rules::puppet::master': + puppetserver => $puppetserver, + puppetserver_port => $puppetserver_port, + puppetserver_signport => $puppetserver_signport, + } } - if hiera('use_munin',false) { + if $manage_munin { include puppet::master::munin } } diff --git a/manifests/master/hasdb.pp b/manifests/master/hasdb.pp index d3bf388..66aeb62 100644 --- a/manifests/master/hasdb.pp +++ b/manifests/master/hasdb.pp @@ -5,11 +5,11 @@ define puppet::master::hasdb ( # this is needed due to the collection of the databases $dbhostfqdn = $::fqdn, $dbuser = 'puppet', - $dbpwd = hiera('puppet_master_storeconfigs_password',false), + $dbpwd = false, $dbconnectinghost = 'locahost' ) { - if !$dbpwd { fail("No \$puppet_master_storeconfig_password is set, please set it in your hiera database") } + if !$dbpwd { fail('No $puppet_master_storeconfig_password is set, please pass it the master class') } case $dbtype { 'mysql': { puppet::master::hasdb::mysql{$name: dbname => $dbname, dbhost => $dbhost, dbuser => $dbuser, dbpwd => $dbpwd, } } diff --git a/manifests/master/hasdb/mysql.pp b/manifests/master/hasdb/mysql.pp index bc15756..5f4985a 100644 --- a/manifests/master/hasdb/mysql.pp +++ b/manifests/master/hasdb/mysql.pp @@ -23,7 +23,7 @@ define puppet::master::hasdb::mysql ( tag => "mysql_${dbhostfqdn}", } - if hiera('use_munin',false) { + if $puppet::master::manage_munin { munin::plugin::deploy { 'puppetresources': source => "puppet/munin/puppetresources.mysql", config => "env.mysqlopts --user=$dbuser --password=$dbpwd -h $dbhost\nenv.puppetdb $dbname", -- cgit v1.2.3