From 2f9f76682c02770f47922435f815177ceec15fd9 Mon Sep 17 00:00:00 2001 From: Christoph Date: Tue, 3 Jun 2014 15:48:35 +0200 Subject: move hiera from site.pp to site_config::setup the problem was following: if a host has the webapp service, the template for /etc/hosts adds some stuff. But setup.pp did not ask hiera about the services so "/srv/leap/bin/puppet_command set_hostname" always resets the hostname. Since that gets triggered every time you run "leap deploy" the hostname changes, some services restart, then the hostname changes back and the services restart again. The solution is to get the hiera data before every run. --- puppet/manifests/site.pp | 3 --- 1 file changed, 3 deletions(-) (limited to 'puppet/manifests') diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp index f8726fa9..1eafec64 100644 --- a/puppet/manifests/site.pp +++ b/puppet/manifests/site.pp @@ -1,9 +1,6 @@ # set a default exec path Exec { path => '/usr/bin:/usr/sbin/:/bin:/sbin:/usr/local/bin:/usr/local/sbin' } -# parse services for host -$services=join(hiera_array('services', ['']), ' ') -notice("Services for ${fqdn}: ${services}") include site_config::setup include site_config::default -- cgit v1.2.3 From 79295764ebbefd346407b8042bc759552aa46234 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 4 Jun 2014 13:05:56 -0700 Subject: bugfix: actually apply modules based on $services --- puppet/manifests/site.pp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'puppet/manifests') diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp index 1eafec64..9afa5dfd 100644 --- a/puppet/manifests/site.pp +++ b/puppet/manifests/site.pp @@ -1,42 +1,44 @@ # set a default exec path Exec { path => '/usr/bin:/usr/sbin/:/bin:/sbin:/usr/local/bin:/usr/local/sbin' } - include site_config::setup include site_config::default -# configure eip -if $services =~ /\bopenvpn\b/ { +$services = hiera('services', []) +$services_str = join($services, ', ') +notice("Services for ${fqdn}: ${services_str}") + +if member($services, 'openvpn') { include site_openvpn } -if $services =~ /\bcouchdb\b/ { +if member($services, 'couchdb') { include site_couchdb include tapicero } -if $services =~ /\bwebapp\b/ { +if member($services, 'webapp') { include site_webapp include site_nickserver } -if $services =~ /\bsoledad\b/ { +if member($services, 'soledad') { include soledad::server } -if $services =~ /\bmonitor\b/ { +if member($services, 'monitor') { include site_nagios } -if $services =~ /\btor\b/ { +if member($services, 'tor') { include site_tor } -if $services =~ /\bmx\b/ { +if member($services, 'mx') { include site_mx } -if $services =~ /\bstatic\b/ { +if member($services, 'static') { include site_static } -- cgit v1.2.3