diff --git a/servers/install-server b/servers/install-server index 9970300807..86e188d55b 100755 --- a/servers/install-server +++ b/servers/install-server @@ -74,7 +74,7 @@ scp -i "$amazon_key_file" "$humbug_cert_file" root@"$server":/root/humbug/certs/ ssh "$server" -t -i "$amazon_key_file" -lroot < "$type"}' # These server restarting bits should be moveable into puppet-land, ideally apt-get -y upgrade if [ -e "/etc/init.d/nginx" ]; then diff --git a/servers/puppet/modules/humbug/manifests/base.pp b/servers/puppet/modules/humbug/manifests/base.pp index ce93bca3f3..bc50896a54 100644 --- a/servers/puppet/modules/humbug/manifests/base.pp +++ b/servers/puppet/modules/humbug/manifests/base.pp @@ -1,6 +1,4 @@ class humbug::base { - class {'humbug': } - $packages = [ "screen", "strace", "vim", "emacs23-nox", "git", "python-tz", "sqlite3", "ntp", "python-simplejson", "host", "openssh-server", "python-pip", "puppet-el", diff --git a/servers/puppet/modules/humbug/manifests/init.pp b/servers/puppet/modules/humbug/manifests/init.pp index b15dfd1872..e418945e81 100644 --- a/servers/puppet/modules/humbug/manifests/init.pp +++ b/servers/puppet/modules/humbug/manifests/init.pp @@ -1,4 +1,12 @@ -class humbug { +class humbug ($machinetype) { + class { "humbug::$machinetype": } + + file { '/etc/humbug-machinetype': + ensure => file, + mode => 644, + content => "$machinetype\n", + } + Exec { path => "/usr/sbin:/usr/bin:/sbin:/bin" } class {'apt': } diff --git a/servers/update-server b/servers/update-server new file mode 100755 index 0000000000..8eb90faaaf --- /dev/null +++ b/servers/update-server @@ -0,0 +1,10 @@ +#!/bin/bash + +machinetype=$(cat /etc/humbug-machinetype | sed -e 's/\n$//') +if [ -z "$machinetype" ]; then + echo "No /etc/humbug-machinetype file found." + echo "Please create it and then re-run this script." + exit 1 +fi + +puppet apply -e "class {'humbug': machinetype => '$machinetype'}"