From 09c54e65db7a594ee1360457d22a594f1f3523b6 Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Tue, 28 Aug 2012 11:13:48 +0200 Subject: [PATCH 01/17] add eucalyptus::conf to clc2, fix dependencies for clc2 --- eucalyptus/manifests/clc2.pp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/eucalyptus/manifests/clc2.pp b/eucalyptus/manifests/clc2.pp index 3b4fef8..c9ed789 100644 --- a/eucalyptus/manifests/clc2.pp +++ b/eucalyptus/manifests/clc2.pp @@ -1,7 +1,8 @@ class eucalyptus::clc2 ($cloud_name = "cloud1") { + include eucalyptus include eucalyptus::conf - Class[eucalyptus] -> Class[eucalyptus::clc2] + Class[eucalyptus::repo] -> Package[eucalyptus-cloud] -> Class[eucalyptus::clc2_config] -> Eucalyptus_config<||> -> Service[eucalyptus-cloud] class eucalyptus::clc2_install { package { 'eucalyptus-cloud': @@ -14,12 +15,9 @@ } } class eucalyptus::clc2_config { - Class[eucalyptus::clc2_install] -> Class[eucalyptus::clc2_config] File <<|title == "${cloud_name}_cloud_cert"|>> File <<|title == "${cloud_name}_cloud_pk"|>> File <<|title == "${cloud_name}_euca.p12"|>> - Package[eucalyptus-cloud] -> Eucalyptus_config<||> -> Service[eucalyptus-cloud] - Eucalyptus_config <||> } class eucalyptus::clc2_reg { @@exec { "reg_clc_${hostname}": From ac8dbc2e6240755aba5d91bd3bac0ff1c5805b8d Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Wed, 19 Sep 2012 08:40:55 +0200 Subject: [PATCH 02/17] use property_name as exec title in cloud_properties configs to stop conflicts when setting up properties for two clusters --- eucalyptus/manifests/cloud_properties.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eucalyptus/manifests/cloud_properties.pp b/eucalyptus/manifests/cloud_properties.pp index 235d5c0..e993877 100644 --- a/eucalyptus/manifests/cloud_properties.pp +++ b/eucalyptus/manifests/cloud_properties.pp @@ -28,7 +28,7 @@ $property_value ) { # Exec using euca-modify-property - exec { "cloud_property_${property_value}": + exec { "cloud_property_${property_name}": command => "/usr/sbin/euca-modify-property -p $property_name=$property_value", unless => "/usr/sbin/euca-describe-properties | /bin/grep -i '$property_name' | /bin/grep -qi '$property_value'", } From 1a699ad97a5bcfb4244e585a4693a76b924f6035 Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Tue, 9 Oct 2012 06:16:22 -0400 Subject: [PATCH 03/17] Add link to quickstart wiki page in readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index fb176fe..ad2aa9f 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,7 @@ Eucalyptus-Puppet Integration This module is designed to configure Eucalyptus components on physical nodes. It contains classes for the 5 main software components as well as certain OS dependencies. So far, it has been tested with CentOS and Puppet 2.7.3 +To find out more on using this module, read the quickstart guide: +https://github.com/eucalyptus/puppetlabs-eucalyptus/wiki/Quickstart:-Puppet-2.7-&-Eucalyptus + [Eucalyptus](http://www.eucalyptus.com) From cbcae23851ea35b2e186060fcad143d7f5a980a1 Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Tue, 9 Oct 2012 07:17:31 -0400 Subject: [PATCH 04/17] Update config type to allow multiple options on one line --- eucalyptus/lib/puppet/type/eucalyptus_config.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eucalyptus/lib/puppet/type/eucalyptus_config.rb b/eucalyptus/lib/puppet/type/eucalyptus_config.rb index 3e8f543..be0fc51 100644 --- a/eucalyptus/lib/puppet/type/eucalyptus_config.rb +++ b/eucalyptus/lib/puppet/type/eucalyptus_config.rb @@ -3,14 +3,14 @@ ensurable newparam(:name, :namevar => true) do - newvalues(/^\S+$/) + newvalues(/^\S+(.*?)$/) end newproperty(:value) do munge do |value| value.to_s end - newvalues(/^\S+$/) + newvalues(/^\S+(.*?)$/) end newproperty(:target) do From b28e7d6ec0277d12753b526ebb3d076399d4dd83 Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Tue, 9 Oct 2012 07:27:47 -0400 Subject: [PATCH 05/17] Add DISABLE_TUNNELING config, default to yes --- eucalyptus/manifests/conf.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eucalyptus/manifests/conf.pp b/eucalyptus/manifests/conf.pp index 38899a9..fb56206 100644 --- a/eucalyptus/manifests/conf.pp +++ b/eucalyptus/manifests/conf.pp @@ -28,6 +28,7 @@ $instance_path = "/var/lib/eucalyptus/instances", $vnet_bridge = "br0", $vnet_dhcpdaemon = "/usr/sbin/dhcpd41", + $vnet_disable_tunneling = "y", ) { @eucalyptus_config { @@ -59,5 +60,6 @@ 'INSTANCE_PATH': value => $instance_path; 'VNET_BRIDGE': value => $vnet_bridge; 'VNET_DHCPDAEMON': value => $vnet_dhcpdaemon; + 'DISABLE_TUNNELING': value => $vnet_disable_tunneling; } } From c765f6cab864a21abbb97c76cf28320bd1f9accd Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Tue, 9 Oct 2012 08:41:00 -0400 Subject: [PATCH 06/17] Add tries and try_sleep to cloud_properties exec --- eucalyptus/manifests/cloud_properties.pp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eucalyptus/manifests/cloud_properties.pp b/eucalyptus/manifests/cloud_properties.pp index e993877..455c0c6 100644 --- a/eucalyptus/manifests/cloud_properties.pp +++ b/eucalyptus/manifests/cloud_properties.pp @@ -29,7 +29,9 @@ ) { # Exec using euca-modify-property exec { "cloud_property_${property_name}": - command => "/usr/sbin/euca-modify-property -p $property_name=$property_value", - unless => "/usr/sbin/euca-describe-properties | /bin/grep -i '$property_name' | /bin/grep -qi '$property_value'", + command => "/usr/sbin/euca-modify-property -p $property_name=$property_value", + unless => "/usr/sbin/euca-describe-properties | /bin/grep -i '$property_name' | /bin/grep -qi '$property_value'", + tries => "3", + try_sleep => "2", } } From cb1819a971d0f2e28489a1bc1e5c256e9c003573 Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Wed, 10 Oct 2012 04:50:25 -0400 Subject: [PATCH 07/17] Add arbitrator support --- eucalyptus/manifests/arbitrator.pp | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 eucalyptus/manifests/arbitrator.pp diff --git a/eucalyptus/manifests/arbitrator.pp b/eucalyptus/manifests/arbitrator.pp new file mode 100644 index 0000000..0ea395c --- /dev/null +++ b/eucalyptus/manifests/arbitrator.pp @@ -0,0 +1,48 @@ +# Arbitrator support (For use in HA mode) +# +# Eucalyptus uses a periodic ICMP echo / ping test to an external IP address. +# This test approximates an end user's ability to access the system. If Eucalyptus determines +# that it cannot reach the host associated with a registered Arbitrator, all Eucalyptus +# services operating on that host attempt to failover to the alternate hosts running those services +# +# == Parameters +# +# [*partition_name*] Unique name for the arbitrator in the cloud +# [*service_host*] Host this arbitrator/ping will run from +# [*gateway_host*] Host to ping to check for connectivity, could be the gateway +# +# == Examples +# +# eucalyptus::arbitrator { 'clc_arbitrator01': +# partition_name => 'clc_arbitrator01', +# service_host => '192.168.0.50', +# gateway_host => '192.168.0.1', +# } +# +# == Authors +# +# Tom Ellis +# +# == Copyright +# +# Copyright 2012 Eucalyptus INC under the Apache 2.0 license + +define eucalyptus::arbitrator( + $partition_name, + $service_host, + $gateway_host, +) { + # Exec using euca-register-arbitrator + exec { "arbitrator_${partition_name}": + command => "/usr/sbin/euca-register-arbitrator -P $partition_name -H $service_host $partition_name", + unless => "/usr/sbin/euca-describe-arbitrators | /bin/grep -i '$partition_name' | /bin/grep -qi '$service_host'", + } + # Use cloud_properties to set the gateway address + # TODO: Get this to run after exec above, since property will not exist unless above has run. + # Can't wrap this in a class. Works at the moment after second puppet run. + eucalyptus::cloud_properties { "arbitrator_gateway_${partition_name}": + property_name => "$partition_name.arbitrator.gatewayhost", + property_value => "$gateway_host", + unless => "/usr/sbin/euca-describe/arbitrators | /bin/grep -i '$partition_name' | /bin/grep -qi '$service_host'", + } +} From 2a74a196a0ceb9bb79817ddf31182160739f0cf8 Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Wed, 10 Oct 2012 04:56:28 -0400 Subject: [PATCH 08/17] update url to quickstart --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ad2aa9f..874835f 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,6 @@ Eucalyptus-Puppet Integration This module is designed to configure Eucalyptus components on physical nodes. It contains classes for the 5 main software components as well as certain OS dependencies. So far, it has been tested with CentOS and Puppet 2.7.3 To find out more on using this module, read the quickstart guide: -https://github.com/eucalyptus/puppetlabs-eucalyptus/wiki/Quickstart:-Puppet-2.7-&-Eucalyptus +https://github.com/eucalyptus/puppetlabs-eucalyptus/wiki/Quickstart:-Puppet-&-Eucalyptus [Eucalyptus](http://www.eucalyptus.com) From d1270f6baa013867518743b891f5410cc21611d5 Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Wed, 10 Oct 2012 05:14:35 -0400 Subject: [PATCH 09/17] add cc_arbitrator to conf file --- eucalyptus/manifests/conf.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eucalyptus/manifests/conf.pp b/eucalyptus/manifests/conf.pp index fb56206..698e458 100644 --- a/eucalyptus/manifests/conf.pp +++ b/eucalyptus/manifests/conf.pp @@ -29,6 +29,7 @@ $vnet_bridge = "br0", $vnet_dhcpdaemon = "/usr/sbin/dhcpd41", $vnet_disable_tunneling = "y", + $cc_arbitrators = "", ) { @eucalyptus_config { @@ -61,5 +62,6 @@ 'VNET_BRIDGE': value => $vnet_bridge; 'VNET_DHCPDAEMON': value => $vnet_dhcpdaemon; 'DISABLE_TUNNELING': value => $vnet_disable_tunneling; + 'CC_ARBITRATORS': value => $cc_arbitrators; } } From 8034f5be49ea24fcb089698ba153910222380cd4 Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Wed, 10 Oct 2012 05:30:17 -0400 Subject: [PATCH 10/17] remove unless from arbitrator define --- eucalyptus/manifests/arbitrator.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/eucalyptus/manifests/arbitrator.pp b/eucalyptus/manifests/arbitrator.pp index 0ea395c..918e3cc 100644 --- a/eucalyptus/manifests/arbitrator.pp +++ b/eucalyptus/manifests/arbitrator.pp @@ -43,6 +43,5 @@ eucalyptus::cloud_properties { "arbitrator_gateway_${partition_name}": property_name => "$partition_name.arbitrator.gatewayhost", property_value => "$gateway_host", - unless => "/usr/sbin/euca-describe/arbitrators | /bin/grep -i '$partition_name' | /bin/grep -qi '$service_host'", } } From cd1f221c5baa38239c279e1f99651a8e1350afea Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Wed, 10 Oct 2012 05:36:04 -0400 Subject: [PATCH 11/17] default to none for cc_arbitrators util conf provider can provide null values --- eucalyptus/manifests/conf.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eucalyptus/manifests/conf.pp b/eucalyptus/manifests/conf.pp index 698e458..71fdc0b 100644 --- a/eucalyptus/manifests/conf.pp +++ b/eucalyptus/manifests/conf.pp @@ -29,7 +29,7 @@ $vnet_bridge = "br0", $vnet_dhcpdaemon = "/usr/sbin/dhcpd41", $vnet_disable_tunneling = "y", - $cc_arbitrators = "", + $cc_arbitrators = "none", ) { @eucalyptus_config { From ebb402896a0d9727538a3db359636bff73da6bea Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Wed, 10 Oct 2012 05:47:37 -0400 Subject: [PATCH 12/17] fix spacing --- eucalyptus/manifests/clc.pp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/eucalyptus/manifests/clc.pp b/eucalyptus/manifests/clc.pp index 9e9e520..15d84f0 100644 --- a/eucalyptus/manifests/clc.pp +++ b/eucalyptus/manifests/clc.pp @@ -24,28 +24,28 @@ # Cloud-wide @@file { "${cloud_name}_cloud_cert": - path => '/var/lib/eucalyptus/keys/cloud-cert.pem', + path => '/var/lib/eucalyptus/keys/cloud-cert.pem', content => "$eucakeys_cloud_cert", - owner => 'eucalyptus', - group => 'eucalyptus', - mode => '0700', - tag => "${cloud_name}", + owner => 'eucalyptus', + group => 'eucalyptus', + mode => '0700', + tag => "${cloud_name}", } @@file { "${cloud_name}_cloud_pk": - path => '/var/lib/eucalyptus/keys/cloud-pk.pem', + path => '/var/lib/eucalyptus/keys/cloud-pk.pem', content => "$eucakeys_cloud_pk", - owner => 'eucalyptus', - group => 'eucalyptus', - mode => '0700', - tag => "${cloud_name}", + owner => 'eucalyptus', + group => 'eucalyptus', + mode => '0700', + tag => "${cloud_name}", } @@file { "${cloud_name}_euca.p12": - path => '/var/lib/eucalyptus/keys/euca.p12', + path => '/var/lib/eucalyptus/keys/euca.p12', content => "$eucakeys_euca_p12", - owner => 'eucalyptus', - group => 'eucalyptus', - mode => '0700', - tag => "${cloud_name}", + owner => 'eucalyptus', + group => 'eucalyptus', + mode => '0700', + tag => "${cloud_name}", } Eucalyptus_config <||> From 361e0be53971f1db6f1a6e04f795f270fc82c995 Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Wed, 10 Oct 2012 06:18:19 -0400 Subject: [PATCH 13/17] fix tags to work with puppet 3.0 --- eucalyptus/manifests/clc.pp | 6 +++--- eucalyptus/manifests/clc2.pp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eucalyptus/manifests/clc.pp b/eucalyptus/manifests/clc.pp index 15d84f0..e9f9fce 100644 --- a/eucalyptus/manifests/clc.pp +++ b/eucalyptus/manifests/clc.pp @@ -29,7 +29,7 @@ owner => 'eucalyptus', group => 'eucalyptus', mode => '0700', - tag => "${cloud_name}", + tag => "${cloud_name}_cloud_cert", } @@file { "${cloud_name}_cloud_pk": path => '/var/lib/eucalyptus/keys/cloud-pk.pem', @@ -37,7 +37,7 @@ owner => 'eucalyptus', group => 'eucalyptus', mode => '0700', - tag => "${cloud_name}", + tag => "${cloud_name}_cloud_cert", } @@file { "${cloud_name}_euca.p12": path => '/var/lib/eucalyptus/keys/euca.p12', @@ -45,7 +45,7 @@ owner => 'eucalyptus', group => 'eucalyptus', mode => '0700', - tag => "${cloud_name}", + tag => "${cloud_name}_cloud_cert", } Eucalyptus_config <||> diff --git a/eucalyptus/manifests/clc2.pp b/eucalyptus/manifests/clc2.pp index c9ed789..40bdc3f 100644 --- a/eucalyptus/manifests/clc2.pp +++ b/eucalyptus/manifests/clc2.pp @@ -15,9 +15,9 @@ } } class eucalyptus::clc2_config { - File <<|title == "${cloud_name}_cloud_cert"|>> - File <<|title == "${cloud_name}_cloud_pk"|>> - File <<|title == "${cloud_name}_euca.p12"|>> + File <<|tag == "${cloud_name}_cloud_cert"|>> + File <<|tag == "${cloud_name}_cloud_pk"|>> + File <<|tag == "${cloud_name}_euca.p12"|>> } class eucalyptus::clc2_reg { @@exec { "reg_clc_${hostname}": From 10d63bdf27be8967a0a146861429f0a51c4c71a9 Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Wed, 10 Oct 2012 16:34:51 +0200 Subject: [PATCH 14/17] Fix class parameter inheritance & dynamic variables, so the module works with puppet 3.0 (see http://docs.puppetlabs.com/guides/scope_and_puppet.html) --- eucalyptus/manifests/cc.pp | 4 ++-- eucalyptus/manifests/clc.pp | 8 ++++---- eucalyptus/manifests/clc2.pp | 4 ++-- eucalyptus/manifests/nc.pp | 4 ++-- eucalyptus/manifests/sc.pp | 4 ++-- eucalyptus/manifests/walrus.pp | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/eucalyptus/manifests/cc.pp b/eucalyptus/manifests/cc.pp index d8cbec8..a99b331 100644 --- a/eucalyptus/manifests/cc.pp +++ b/eucalyptus/manifests/cc.pp @@ -14,7 +14,7 @@ } } - class eucalyptus::cc_config { + class eucalyptus::cc_config inherits eucalyptus::cc { File <<|title == "${cloud_name}_cloud_cert"|>> File <<|title == "${cloud_name}_cloud_pk"|>> File <<|title == "${cloud_name}_${cluster_name}_cluster_cert"|>> @@ -23,7 +23,7 @@ File <<|title == "${cloud_name}_${cluster_name}_node_pk"|>> } - class eucalyptus::cc_reg { + class eucalyptus::cc_reg inherits eucalyptus::cc { Class[eucalyptus::cc_reg] -> Class[eucalyptus::cc_config] @@exec { "reg_cc_${hostname}": command => "/usr/sbin/euca_conf --no-rsync --no-scp --no-sync --register-cluster --partition $cluster_name --host $ipaddress --component cc_$hostname", diff --git a/eucalyptus/manifests/clc.pp b/eucalyptus/manifests/clc.pp index e9f9fce..9634778 100644 --- a/eucalyptus/manifests/clc.pp +++ b/eucalyptus/manifests/clc.pp @@ -13,7 +13,7 @@ } } - class eucalyptus::clc_config { + class eucalyptus::clc_config inherits eucalyptus::clc { Class[eucalyptus::repo] -> Package['eucalyptus-cloud'] -> Class[eucalyptus::conf] -> Exec['init-db'] -> Service['eucalyptus-cloud'] -> Class[eucalyptus::clc_reg] exec { 'init-db': @@ -37,7 +37,7 @@ owner => 'eucalyptus', group => 'eucalyptus', mode => '0700', - tag => "${cloud_name}_cloud_cert", + tag => "${cloud_name}_cloud_pk", } @@file { "${cloud_name}_euca.p12": path => '/var/lib/eucalyptus/keys/euca.p12', @@ -45,12 +45,12 @@ owner => 'eucalyptus', group => 'eucalyptus', mode => '0700', - tag => "${cloud_name}_cloud_cert", + tag => "${cloud_name}_euca.p12", } Eucalyptus_config <||> } - class eucalyptus::clc_reg { + class eucalyptus::clc_reg inherits eucalyptus::clc { Class[eucalyptus::clc_config] -> Class[eucalyptus::clc_reg] Exec <<|tag == "$cloud_name"|>> } diff --git a/eucalyptus/manifests/clc2.pp b/eucalyptus/manifests/clc2.pp index 40bdc3f..a4c254e 100644 --- a/eucalyptus/manifests/clc2.pp +++ b/eucalyptus/manifests/clc2.pp @@ -14,12 +14,12 @@ require => Package['eucalyptus-cloud'], } } - class eucalyptus::clc2_config { + class eucalyptus::clc2_config inherits eucalyptus::clc2 { File <<|tag == "${cloud_name}_cloud_cert"|>> File <<|tag == "${cloud_name}_cloud_pk"|>> File <<|tag == "${cloud_name}_euca.p12"|>> } - class eucalyptus::clc2_reg { + class eucalyptus::clc2_reg inherits eucalyptus::clc2 { @@exec { "reg_clc_${hostname}": command => "/usr/sbin/euca_conf --no-rsync --no-scp --no-sync --register-cloud --partition eucalyptus --host $ipaddress --component clc_$hostname", unless => "/usr/sbin/euca_conf --list-clouds | /bin/grep '\b$ipaddress\b'", diff --git a/eucalyptus/manifests/nc.pp b/eucalyptus/manifests/nc.pp index 1fc9a17..20748c0 100644 --- a/eucalyptus/manifests/nc.pp +++ b/eucalyptus/manifests/nc.pp @@ -14,14 +14,14 @@ } } - class eucalyptus::nc_config { + class eucalyptus::nc_config inherits eucalyptus::nc { File <<|title == "${cloud_name}_${cluster_name}_cluster_cert"|>> File <<|title == "${cloud_name}_${cluster_name}_node_cert"|>> File <<|title == "${cloud_name}_${cluster_name}_node_pk"|>> File <<|title == "${cloud_name}_cloud_cert"|>> } - class eucalyptus::nc_reg { + class eucalyptus::nc_reg inherits eucalyptus::nc { #Eucalyptus_config <||> { notify => Service["eucalyptus-nc"] } # Causes too many service refreshes Eucalyptus_config <||> diff --git a/eucalyptus/manifests/sc.pp b/eucalyptus/manifests/sc.pp index 1e410e5..44a66df 100644 --- a/eucalyptus/manifests/sc.pp +++ b/eucalyptus/manifests/sc.pp @@ -15,11 +15,11 @@ } } - class eucalyptus::sc_config { + class eucalyptus::sc_config inherits eucalyptus::sc { File <<|title == "${cloud_name}_euca.p12"|>> } - class eucalyptus::sc_reg { + class eucalyptus::sc_reg inherits eucalyptus::sc { Class[eucalyptus::sc_reg] -> Class[eucalyptus::sc_config] @@exec { "reg_sc_${hostname}": command => "/usr/sbin/euca_conf --no-rsync --no-scp --no-sync --register-sc --partition ${cluster_name} --host $ipaddress --component sc_$hostname", diff --git a/eucalyptus/manifests/walrus.pp b/eucalyptus/manifests/walrus.pp index abcf55d..3f46e2a 100644 --- a/eucalyptus/manifests/walrus.pp +++ b/eucalyptus/manifests/walrus.pp @@ -15,11 +15,11 @@ } } - class eucalyptus::walrus_config { + class eucalyptus::walrus_config inherits eucalyptus::walrus { File <<|title == "${cloud_name}_euca.p12"|>> } - class eucalyptus::walrus_reg { + class eucalyptus::walrus_reg inherits eucalyptus::walrus { @@exec { "reg_walrus_${hostname}": command => "/usr/sbin/euca_conf --no-rsync --no-scp --no-sync --register-walrus --partition walrus --host $ipaddress --component walrus_$hostname", unless => "/usr/sbin/euca_conf --list-walruses | /bin/grep '\b$ipaddress\b'", From 6ffb7fb80d0b0d0e62218110f891965b87e8496b Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Wed, 10 Oct 2012 16:50:56 +0200 Subject: [PATCH 15/17] remove legacy hypervisor manifest --- eucalyptus/manifests/hypervisor.pp | 43 ------------------------------ 1 file changed, 43 deletions(-) delete mode 100644 eucalyptus/manifests/hypervisor.pp diff --git a/eucalyptus/manifests/hypervisor.pp b/eucalyptus/manifests/hypervisor.pp deleted file mode 100644 index 92f28b8..0000000 --- a/eucalyptus/manifests/hypervisor.pp +++ /dev/null @@ -1,43 +0,0 @@ -class eucalyptus::hypervisor { - # yum install xen kernel-xen libvirt - package { 'xen': ensure => present } - package { 'kernel-xen': ensure => present } - package { 'libvirt': ensure => present } - - # Edit /etc/grub.conf to boot Xen kernel (drop in new file) - file { 'grub': - name => '/etc/grub.conf', - owner => 'root', - group => 'root', - mode => '0644', - source => 'puppet:///modules/eucalyptus/grub.conf', - require => Package['xen', 'kernel-xen'], - } - # Edit /etc/xen/xend-config.sxp (drop in new file) - file { 'xend-config': - name => '/etc/xen/xend-config.sxp', - owner => 'root', - group => 'root', - mode => '0644', - source => 'puppet:///modules/eucalyptus/xen/xend-config.sxp', - require => Package['xen', 'kernel-xen'], - } - - # Restart xend - service { 'xend': - enable => true, - hasstatus => true, - hasrestart => true, - ensure => running, - require => File['xend-config'], - } - - # Edit /etc/libvirt/libvirtd.conf (drop in new file) - file { '/etc/libvirt/libvirt.conf': - owner => 'root', - group => 'root', - mode => '0644', - source => 'puppet:///modules/eucalyptus/libvirt/libvirt.conf', - require => Package['libvirt'], - } -} From fed6d90a62651d4ad6b09fb5db5ff09b65db207e Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Wed, 10 Oct 2012 17:37:26 +0200 Subject: [PATCH 16/17] Add vtun support to custom fact, align spacing in cluster.pp and add vtunpass --- eucalyptus/manifests/cluster.pp | 49 +++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/eucalyptus/manifests/cluster.pp b/eucalyptus/manifests/cluster.pp index 42605e3..3eff7ea 100644 --- a/eucalyptus/manifests/cluster.pp +++ b/eucalyptus/manifests/cluster.pp @@ -5,38 +5,47 @@ # One of these for each cluster $node_cert = "eucakeys_${cluster_name}_node_cert" @@file { "${cloud_name}_${cluster_name}_node_cert": - path => '/var/lib/eucalyptus/keys/node-cert.pem', + path => '/var/lib/eucalyptus/keys/node-cert.pem', content => inline_template("<%= scope.lookupvar(node_cert) %>"), - owner => 'eucalyptus', - group => 'eucalyptus', - mode => '0700', - tag => "${cloud_name}", + owner => 'eucalyptus', + group => 'eucalyptus', + mode => '0700', + tag => "${cloud_name}", } $nc_pk = "eucakeys_${cluster_name}_node_pk" @@file { "${cloud_name}_${cluster_name}_node_pk": - path => '/var/lib/eucalyptus/keys/node-pk.pem', + path => '/var/lib/eucalyptus/keys/node-pk.pem', content => inline_template("<%= scope.lookupvar(nc_pk) %>"), - owner => 'eucalyptus', - group => 'eucalyptus', - mode => '0700', - tag => "${cloud_name}", + owner => 'eucalyptus', + group => 'eucalyptus', + mode => '0700', + tag => "${cloud_name}", } $cc_cert = "eucakeys_${cluster_name}_cluster_cert" @@file { "${cloud_name}_${cluster_name}_cluster_cert": - path => '/var/lib/eucalyptus/keys/cluster-cert.pem', + path => '/var/lib/eucalyptus/keys/cluster-cert.pem', content => inline_template("<%= scope.lookupvar(cc_cert) %>"), - owner => 'eucalyptus', - group => 'eucalyptus', - mode => '0700', - tag => "${cloud_name}", + owner => 'eucalyptus', + group => 'eucalyptus', + mode => '0700', + tag => "${cloud_name}", } $cc_pk = "eucakeys_${cluster_name}_cluster_pk" @@file { "${cloud_name}_${cluster_name}_cluster_pk": - path => '/var/lib/eucalyptus/keys/cluster-pk.pem', + path => '/var/lib/eucalyptus/keys/cluster-pk.pem', content => inline_template("<%= scope.lookupvar(cc_pk) %>"), - owner => 'eucalyptus', - group => 'eucalyptus', - mode => '0700', - tag => "${cloud_name}", + owner => 'eucalyptus', + group => 'eucalyptus', + mode => '0700', + tag => "${cloud_name}", + } + $cc_vtunpass = "eucakeys_${cluster_name}_vtunpass" + @@file { "${cloud_name}_${cluster_name}_vtunpass": + path => '/var/lib/eucalyptus/keys/vtunpass', + content => inline_template("<%= scope.lookupvar(cc_vtunpass) %>"), + owner => 'eucalyptus', + group => 'eucalyptus', + mode => '0700', + tag => "${cloud_name}", } } From 88232251d7f59fc3d06cc12632a6f52cdb73d828 Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Wed, 10 Oct 2012 17:38:02 +0200 Subject: [PATCH 17/17] update custom fact to include vtun support --- eucalyptus/lib/facter/eucakeys.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/eucalyptus/lib/facter/eucakeys.rb b/eucalyptus/lib/facter/eucakeys.rb index 14877d7..6852453 100644 --- a/eucalyptus/lib/facter/eucakeys.rb +++ b/eucalyptus/lib/facter/eucakeys.rb @@ -37,7 +37,15 @@ Facter.add("eucakeys_" + clustername + "_#{keyname.sub('.pem','').sub('-','_')}") do setcode do File.read("#{eucakey_dir}/#{clustername}/#{keyname}") - end + end + end + end + # Collect VPN tunnel passwords for VNET_TUNNELLING + if keyname.match(/vtunpass/) + Facter.add("eucakeys_" + clustername + "_#{keyname}") do + setcode do + File.read("#{eucakey_dir}/#{clustername}/#{keyname}") + end end end end