chef-vpc-toolkit 2.5.1 → 2.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ * Thu Apr 24 2011 Dan Prince <dan.prince@rackspace.com> - 2.5.2
2
+ - Raise an error in the chef:poll_clients task if a timeout occurs.
3
+ - Use CDN to install Chef for Ubuntu.
4
+
1
5
  * Thu Apr 16 2011 Dan Prince <dan.prince@rackspace.com> - 2.5.1
2
6
  - Updates to support Ruby 1.9.2.
3
7
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.5.1
1
+ 2.5.2
@@ -0,0 +1,34 @@
1
+ function install_chef {
2
+
3
+ CODENAME=$(cat /etc/*release | grep CODENAME | sed -e "s|^.*=\([^$]*\)$|\1|")
4
+ [[ "$CODENAME" == "maverick" ]] && CODENAME="lucid"
5
+ local INSTALL_TYPE=${1:-"CLIENT"} # CLIENT/SERVER
6
+
7
+ [ -f /etc/apt/sources.list.d/opscode.list ] || echo "deb http://apt.opscode.com $CODENAME main" > /etc/apt/sources.list.d/opscode.list
8
+ wget -q -O- http://apt.opscode.com/packages@opscode.com.gpg.key | apt-key add - &> /dev/null || { echo "Failed to configure Apt repo."; exit 1; }
9
+
10
+ dpkg -L rsync &> /dev/null || apt-get install -y rsync &> /dev/null
11
+
12
+ if ! dpkg -L chef &> /dev/null; then
13
+
14
+ if [[ "$INSTALL_TYPE" == "SERVER" ]]; then
15
+
16
+ [[ "$CODENAME" == "lucid" ]] || { echo "Ubuntu 10.0.4 lucid is required for Chef server installations."; exit 1; }
17
+ apt-get update &> /dev/null || { echo "Failed to apt-get update."; exit 1; }
18
+ echo "chef-solr chef-solr/amqp_password password YA1B2C301234Z" | debconf-set-selections &> /dev/null || { echo "Failed to set debconf selections for chef-solr."; exit 1; }
19
+ echo "chef chef/chef_server_url string http://localhost:4000" | debconf-set-selections &> /dev/null || { echo "Failed to set debconf selections for chef."; exit 1; }
20
+ DEBIAN_FRONTEND=noninteractive apt-get install -y chef-server chef &> /dev/null || { echo "Failed to install the Chef Server via apt-get on $HOSTNAME."; exit 1; }
21
+ else
22
+ apt-get update &> /dev/null || { echo "Failed to apt-get update."; exit 1; }
23
+ echo "chef chef/chef_server_url string http://localhost:4000" | debconf-set-selections &> /dev/null || { echo "Failed to set debconf selections for chef."; exit 1; }
24
+ DEBIAN_FRONTEND=noninteractive apt-get install -y chef &> /dev/null || { echo "Failed to install Chef via apt-get on $HOSTNAME."; exit 1; }
25
+ fi
26
+
27
+ /etc/init.d/chef-client stop &> /dev/null
28
+ sleep 2
29
+ kill -9 $(pgrep chef-client) &> /dev/null || true
30
+ rm /var/log/chef/client.log
31
+
32
+ fi
33
+
34
+ }
@@ -1,28 +1,46 @@
1
1
  function install_chef {
2
2
 
3
3
  CODENAME=$(cat /etc/*release | grep CODENAME | sed -e "s|^.*=\([^$]*\)$|\1|")
4
- [[ "$CODENAME" == "maverick" ]] && CODENAME="lucid"
5
4
  local INSTALL_TYPE=${1:-"CLIENT"} # CLIENT/SERVER
6
5
 
7
- [ -f /etc/apt/sources.list.d/opscode.list ] || echo "deb http://apt.opscode.com $CODENAME main" > /etc/apt/sources.list.d/opscode.list
8
- wget -q -O- http://apt.opscode.com/packages@opscode.com.gpg.key | apt-key add - &> /dev/null || { echo "Failed to configure Apt repo."; exit 1; }
6
+ local CDN_BASE="http://c2521002.cdn.cloudfiles.rackspacecloud.com"
7
+ local TARBALL="chef-client-0.9.16-ubuntu.10.10-x86_64.tar.gz"
9
8
 
9
+ if [[ "$CODENAME" == "lucid" ]]; then
10
+ if [[ "$INSTALL_TYPE" == "SERVER" ]]; then
11
+ TARBALL="chef-server-0.9.16-ubuntu.10.04-x86_64.tar.gz"
12
+ else
13
+ TARBALL="chef-client-0.9.16-ubuntu.10.04-x86_64.tar.gz"
14
+ fi
15
+ elif [[ "$CODENAME" == "maverick" ]]; then
16
+ if [[ "$INSTALL_TYPE" == "SERVER" ]]; then
17
+ TARBALL="chef-server-0.9.16-ubuntu.10.10-x86_64.tar.gz"
18
+ else
19
+ TARBALL="chef-client-0.9.16-ubuntu.10.10-x86_64.tar.gz"
20
+ fi
21
+ else
22
+ echo "Only Ubuntu 10.04 and 10.10 are supported Chef clients."; exit 1;
23
+ fi
24
+
25
+ apt-get update &> /dev/null || { echo "Failed to apt-get update."; exit 1; }
10
26
  dpkg -L rsync &> /dev/null || apt-get install -y rsync &> /dev/null
11
27
 
12
28
  if ! dpkg -L chef &> /dev/null; then
13
29
 
14
- if [[ "$INSTALL_TYPE" == "SERVER" ]]; then
30
+ local CHEF_PACKAGES_DIR=$(mktemp -d)
15
31
 
16
- [[ "$CODENAME" == "lucid" ]] || { echo "Ubuntu 10.0.4 lucid is required for Chef server installations."; exit 1; }
17
- apt-get update &> /dev/null || { echo "Failed to apt-get update."; exit 1; }
18
- echo "chef-solr chef-solr/amqp_password password YA1B2C301234Z" | debconf-set-selections &> /dev/null || { echo "Failed to set debconf selections for chef-solr."; exit 1; }
19
- echo "chef chef/chef_server_url string http://localhost:4000" | debconf-set-selections &> /dev/null || { echo "Failed to set debconf selections for chef."; exit 1; }
20
- DEBIAN_FRONTEND=noninteractive apt-get install -y chef-server chef &> /dev/null || { echo "Failed to install the Chef Server via apt-get on $HOSTNAME."; exit 1; }
21
- else
22
- apt-get update &> /dev/null || { echo "Failed to apt-get update."; exit 1; }
23
- echo "chef chef/chef_server_url string http://localhost:4000" | debconf-set-selections &> /dev/null || { echo "Failed to set debconf selections for chef."; exit 1; }
24
- DEBIAN_FRONTEND=noninteractive apt-get install -y chef &> /dev/null || { echo "Failed to install Chef via apt-get on $HOSTNAME."; exit 1; }
25
- fi
32
+ wget "$CDN_BASE/$TARBALL" -O "$CHEF_PACKAGES_DIR/chef.tar.gz" &> /dev/null \
33
+ || { echo "Failed to download Chef RPM tarball."; exit 1; }
34
+ cd $CHEF_PACKAGES_DIR
35
+ tar xzf chef.tar.gz || { echo "Failed to extract Chef tarball."; exit 1; }
36
+ rm chef.tar.gz
37
+
38
+ echo "chef-solr chef-solr/amqp_password password YA1B2C301234Z" | debconf-set-selections &> /dev/null || { echo "Failed to set debconf selections for chef-solr."; exit 1; }
39
+ echo "chef chef/chef_server_url string http://localhost:4000" | debconf-set-selections &> /dev/null || { echo "Failed to set debconf selections for chef."; exit 1; }
40
+ DEBIAN_FRONTEND=noninteractive dpkg -i -R chef* &> /dev/null || { echo "Failed to install the Chef Server via apt-get on $HOSTNAME."; exit 1; }
41
+
42
+ cd /tmp
43
+ rm -Rf $CHEF_PACKAGES_DIR
26
44
 
27
45
  /etc/init.d/chef-client stop &> /dev/null
28
46
  sleep 2
@@ -230,7 +230,9 @@ namespace :chef do
230
230
  configs=ChefInstaller.load_configs
231
231
  configs["ssh_gateway_ip"]=group.vpn_gateway_ip
232
232
  puts "Polling for Chef clients to finish running..."
233
- ChefInstaller.poll_clients(configs, server_list, timeout)
233
+ if not ChefInstaller.poll_clients(configs, server_list, timeout) then
234
+ raise "Chef client timeout."
235
+ end
234
236
 
235
237
  end
236
238
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-vpc-toolkit
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 5
9
- - 1
10
- version: 2.5.1
9
+ - 2
10
+ version: 2.5.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dan Prince
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-16 00:00:00 -04:00
18
+ date: 2011-04-27 00:00:00 -07:00
19
19
  default_executable: chef-vpc-toolkit
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -119,6 +119,7 @@ files:
119
119
  - lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
120
120
  - lib/chef-vpc-toolkit/chef_bootstrap/fedora.bash
121
121
  - lib/chef-vpc-toolkit/chef_bootstrap/rhel.bash
122
+ - lib/chef-vpc-toolkit/chef_bootstrap/ubuntu-opscode.bash
122
123
  - lib/chef-vpc-toolkit/chef_bootstrap/ubuntu.bash
123
124
  - lib/chef-vpc-toolkit/chef_installer.rb
124
125
  - lib/chef-vpc-toolkit/cloud-servers-vpc/client.rb