From ab9a292f41139c5c5e36de87e03236e29dd27e23 Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 31 Jan 2013 11:09:20 +0100 Subject: puppet tags: site_config::default and site_config::slow --- puppet/manifests/site.pp | 66 ++++++++++------------ puppet/modules/site_config/manifests/default.pp | 28 +++++++++ puppet/modules/site_config/manifests/hosts.pp | 2 +- puppet/modules/site_config/manifests/init.pp | 29 ---------- puppet/modules/site_config/manifests/resolvconf.pp | 2 +- puppet/modules/site_config/manifests/slow.pp | 6 ++ 6 files changed, 65 insertions(+), 68 deletions(-) create mode 100644 puppet/modules/site_config/manifests/default.pp delete mode 100644 puppet/modules/site_config/manifests/init.pp create mode 100644 puppet/modules/site_config/manifests/slow.pp diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp index 33566f0c..146b373e 100644 --- a/puppet/manifests/site.pp +++ b/puppet/manifests/site.pp @@ -5,41 +5,33 @@ stage { 'initial': before => Stage['main'], } -node 'default' { - # prerequisites - import 'common' - include concat::setup - - $development = hiera('development') - if $development['site_config'] == true { - # include some basic classes - include site_config - } else { - notice ('NOT applying site_config') - } - - # parse services for host - $services=hiera_array('services') - notice("Services for $fqdn: $services") - - # configure eip - if 'openvpn' in $services { - include site_openvpn - } - - if 'couchdb' in $services { - include site_couchdb - } - - if 'webapp' in $services { - include site_webapp - } - - if 'ca' in $services { - include site_ca_daemon - } - - if 'monitor' in $services { - include site_nagios::server - } +# prerequisites +import 'common' +include concat::setup +include site_config::default +include site_config::slow + +# parse services for host +$services=hiera_array('services') +notice("Services for ${fqdn}: ${services}") + +# configure eip +if 'openvpn' in $services { + include site_openvpn +} + +if 'couchdb' in $services { + include site_couchdb +} + +if 'webapp' in $services { + include site_webapp +} + +if 'ca' in $services { + include site_ca_daemon +} + +if 'monitor' in $services { + include site_nagios::server } diff --git a/puppet/modules/site_config/manifests/default.pp b/puppet/modules/site_config/manifests/default.pp new file mode 100644 index 00000000..0605604b --- /dev/null +++ b/puppet/modules/site_config/manifests/default.pp @@ -0,0 +1,28 @@ +class site_config::default { + tag 'default' + + $domain_hash = hiera('domain') + + # default class, used by all hosts + + include lsb, git + + # configure apt + include site_apt + + + # configure ssh and include ssh-keys + include site_config::sshd + + # configure /etc/resolv.conf + include site_config::resolvconf + + # configure caching, local resolver + include site_config::caching_resolver + + # configure /etc/hosts + class { 'site_config::hosts': + stage => initial, + } + +} diff --git a/puppet/modules/site_config/manifests/hosts.pp b/puppet/modules/site_config/manifests/hosts.pp index a5f1b105..6c00f3b6 100644 --- a/puppet/modules/site_config/manifests/hosts.pp +++ b/puppet/modules/site_config/manifests/hosts.pp @@ -3,7 +3,7 @@ class site_config::hosts() { $hosts = hiera('hosts','') $hostname = hiera('name') - $domain_public = $site_config::domain_hash['full_suffix'] + $domain_public = $site_config::default::domain_hash['full_suffix'] file { "/etc/hostname": ensure => present, diff --git a/puppet/modules/site_config/manifests/init.pp b/puppet/modules/site_config/manifests/init.pp deleted file mode 100644 index f0ce9856..00000000 --- a/puppet/modules/site_config/manifests/init.pp +++ /dev/null @@ -1,29 +0,0 @@ -class site_config { - $domain_hash = hiera('domain') - - # default class, used by all hosts - - include lsb, git - - # configure apt - include site_apt - - - # configure ssh and include ssh-keys - include site_config::sshd - - # configure /etc/resolv.conf - include site_config::resolvconf - - # configure caching, local resolver - include site_config::caching_resolver - - # configure /etc/hosts - class { 'site_config::hosts': - stage => initial, - } - - class { 'site_apt::dist_upgrade': - stage => initial, - } -} diff --git a/puppet/modules/site_config/manifests/resolvconf.pp b/puppet/modules/site_config/manifests/resolvconf.pp index b803f17e..d73f0b78 100644 --- a/puppet/modules/site_config/manifests/resolvconf.pp +++ b/puppet/modules/site_config/manifests/resolvconf.pp @@ -11,7 +11,7 @@ class site_config::resolvconf { ensure => absent; } - $domain_public = $site_config::domain_hash['full_suffix'] + $domain_public = $site_config::default::domain_hash['full_suffix'] # 127.0.0.1: caching-only local bind # 87.118.100.175: http://server.privacyfoundation.de diff --git a/puppet/modules/site_config/manifests/slow.pp b/puppet/modules/site_config/manifests/slow.pp new file mode 100644 index 00000000..a4a9f19f --- /dev/null +++ b/puppet/modules/site_config/manifests/slow.pp @@ -0,0 +1,6 @@ +class site_config::slow { + + class { 'site_apt::dist_upgrade': + stage => initial, + } +} -- cgit v1.2.3 From ced1717ae310c5b24fffd041c8af38b016d90ed4 Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 31 Jan 2013 11:40:41 +0100 Subject: include site_nagios so every subclass inherits tag 'service' --- puppet/manifests/site.pp | 2 +- puppet/modules/site_nagios/manifests/init.pp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 puppet/modules/site_nagios/manifests/init.pp diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp index 146b373e..d422bef7 100644 --- a/puppet/manifests/site.pp +++ b/puppet/manifests/site.pp @@ -33,5 +33,5 @@ if 'ca' in $services { } if 'monitor' in $services { - include site_nagios::server + include site_nagios } diff --git a/puppet/modules/site_nagios/manifests/init.pp b/puppet/modules/site_nagios/manifests/init.pp new file mode 100644 index 00000000..57da3011 --- /dev/null +++ b/puppet/modules/site_nagios/manifests/init.pp @@ -0,0 +1,4 @@ +class site_nagios { + tag 'service' + include site_nagios::server +} -- cgit v1.2.3 From 5addc36a364186d53d13304182d6f41b30f6a890 Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 31 Jan 2013 11:41:13 +0100 Subject: just purge the nagios3/conf.d content, not the dir itself --- puppet/modules/site_nagios/manifests/server/purge.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/puppet/modules/site_nagios/manifests/server/purge.pp b/puppet/modules/site_nagios/manifests/server/purge.pp index 66c27dd5..39735cd3 100644 --- a/puppet/modules/site_nagios/manifests/server/purge.pp +++ b/puppet/modules/site_nagios/manifests/server/purge.pp @@ -1,6 +1,6 @@ class site_nagios::server::purge { exec {'purge_conf.d': - command => '/bin/rm -rf /etc/nagios3/conf.d', + command => '/bin/rm -rf /etc/nagios3/conf.d/*', onlyif => 'test -e /etc/nagios3/conf.d' } -- cgit v1.2.3 From 42aef6df0091f8879d83860efd3c08a6d8e26bdf Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 31 Jan 2013 11:42:58 +0100 Subject: changed tag default to 'base' --- puppet/modules/site_config/manifests/default.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/puppet/modules/site_config/manifests/default.pp b/puppet/modules/site_config/manifests/default.pp index 0605604b..577970ca 100644 --- a/puppet/modules/site_config/manifests/default.pp +++ b/puppet/modules/site_config/manifests/default.pp @@ -1,5 +1,5 @@ class site_config::default { - tag 'default' + tag 'base' $domain_hash = hiera('domain') -- cgit v1.2.3 From dda36946d405301d9123bb455753650920d0756a Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 31 Jan 2013 11:52:32 +0100 Subject: tag 'service' for all service classes --- puppet/modules/site_ca_daemon/manifests/init.pp | 2 +- puppet/modules/site_couchdb/manifests/init.pp | 2 +- puppet/modules/site_openvpn/manifests/init.pp | 1 + puppet/modules/site_webapp/manifests/init.pp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/puppet/modules/site_ca_daemon/manifests/init.pp b/puppet/modules/site_ca_daemon/manifests/init.pp index 4ec5b00b..c00a22c8 100644 --- a/puppet/modules/site_ca_daemon/manifests/init.pp +++ b/puppet/modules/site_ca_daemon/manifests/init.pp @@ -1,5 +1,5 @@ class site_ca_daemon { - + tag 'service' #$definition_files = hiera('definition_files') #$provider = $definition_files['provider'] #$eip_service = $definition_files['eip_service'] diff --git a/puppet/modules/site_couchdb/manifests/init.pp b/puppet/modules/site_couchdb/manifests/init.pp index 04f2ca1a..632df799 100644 --- a/puppet/modules/site_couchdb/manifests/init.pp +++ b/puppet/modules/site_couchdb/manifests/init.pp @@ -1,5 +1,5 @@ class site_couchdb { - + tag 'service' include couchdb $x509 = hiera('x509') diff --git a/puppet/modules/site_openvpn/manifests/init.pp b/puppet/modules/site_openvpn/manifests/init.pp index 0ddb01ae..df4277cd 100644 --- a/puppet/modules/site_openvpn/manifests/init.pp +++ b/puppet/modules/site_openvpn/manifests/init.pp @@ -1,4 +1,5 @@ class site_openvpn { + tag 'service' # parse hiera config $ip_address = hiera('ip_address') $interface = getvar("interface_${ip_address}") diff --git a/puppet/modules/site_webapp/manifests/init.pp b/puppet/modules/site_webapp/manifests/init.pp index c7d918ae..d1951dcd 100644 --- a/puppet/modules/site_webapp/manifests/init.pp +++ b/puppet/modules/site_webapp/manifests/init.pp @@ -1,5 +1,5 @@ class site_webapp { - + tag 'service' $definition_files = hiera('definition_files') $provider = $definition_files['provider'] $eip_service = $definition_files['eip_service'] -- cgit v1.2.3