chef-vpc-toolkit 2.8.0 → 2.8.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,10 @@
1
+ * Tue Dec 8 2011 Dan Prince <dan.prince@rackspace.com> - 2.8.1
2
+ - Add JSON option for chef:install task to specify custom nodes.json files.
3
+ - Don't re-add the notification handler to the config file if it already
4
+ exists.
5
+ - Add support for cloning git:// cookbook repo URL's.
6
+ - Add restart check for Rabbit which sometimes fails or is slow to start.
7
+
1
8
  * Tue Nov 8 2011 Dan Prince <dan.prince@rackspace.com> - 2.8.0
2
9
  - Add chef_interval option to chef_installer.conf.
3
10
  - Add RESTART_ON_FAILURE and RESTART_TIMEOUT options to poll_clients task.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.8.0
1
+ 2.8.1
@@ -38,6 +38,7 @@ local CHEF_NOTIFICATION_HANDLER=/var/lib/chef/handlers/netcat.rb
38
38
  sed -e "s|localhost|$SERVER_NAME|g" -i $CLIENT_CONFIG
39
39
  sed -e "s|^chef_server_url.*|chef_server_url \"http://$SERVER_NAME:4000\"|g" -i $CLIENT_CONFIG
40
40
  sed -e "s|^log_location.*|log_location \"\/var/log/chef/client.log\"|g" -i $CLIENT_CONFIG
41
+ if ! grep "$CHEF_NOTIFICATION_HANDLER" $CLIENT_CONFIG &> /dev/null; then
41
42
  cat >> $CLIENT_CONFIG <<-EOF_CAT_CHEF_CLIENT_CONF
42
43
  # custom Chef notification handler
43
44
  require "$CHEF_NOTIFICATION_HANDLER"
@@ -45,7 +46,7 @@ netcat_handler = NetcatHandler.new
45
46
  report_handlers << netcat_handler
46
47
  exception_handlers << netcat_handler
47
48
  EOF_CAT_CHEF_CLIENT_CONF
48
-
49
+ fi
49
50
 
50
51
  local CHEF_SYSCONFIG=/etc/default/chef-client
51
52
  [ -d /etc/sysconfig/ ] && CHEF_SYSCONFIG=/etc/sysconfig/chef-client
@@ -206,16 +207,30 @@ for CB_REPO in $COOKBOOK_URLS; do
206
207
  echo -n "Downloading $CB_REPO..."
207
208
  if [ "http:" == ${CB_REPO:0:5} ] || [ "https:" == ${CB_REPO:0:6} ]; then
208
209
  wget --no-check-certificate "$CB_REPO" -O "/tmp/cookbook-repo.tar.gz" &> /dev/null || { echo "Failed to download cookbook tarball."; return 1; }
210
+ elif [ "git:" == ${CB_REPO:0:4} ]; then
211
+ if [ -f /usr/bin/yum ]; then
212
+ rpm -q git &> /dev/null || yum install -y -q git
213
+ elif [ -f /usr/bin/dpkg ]; then
214
+ dpkg -L git > /dev/null 2>&1 || apt-get install -y --quiet git > /dev/null 2>&1
215
+ else
216
+ echo "Failed to install git."
217
+ exit 1
218
+ fi
219
+ pushd $REPOS_BASEDIR
220
+ git clone "$CB_REPO"
221
+ popd
209
222
  else
210
223
  download_cloud_file "$CB_REPO" "/tmp/cookbook-repo.tar.gz"
211
224
  fi
212
225
  echo "OK"
213
- [ -d "$REPOS_BASEDIR" ] || mkdir -p "$REPOS_BASEDIR"
214
- cd $REPOS_BASEDIR
215
- echo -n "Extracting $CB_REPO..."
216
- tar xzf /tmp/cookbook-repo.tar.gz
217
- rm /tmp/cookbook-repo.tar.gz
218
- echo "OK"
226
+ if [ -f /tmp/cookbook-repo.tar.gz ]; then
227
+ [ -d "$REPOS_BASEDIR" ] || mkdir -p "$REPOS_BASEDIR"
228
+ cd $REPOS_BASEDIR
229
+ echo -n "Extracting $CB_REPO..."
230
+ tar xzf /tmp/cookbook-repo.tar.gz
231
+ rm /tmp/cookbook-repo.tar.gz
232
+ echo "OK"
233
+ fi
219
234
  done
220
235
 
221
236
  }
@@ -253,6 +268,14 @@ function start_chef_server {
253
268
  /sbin/chkconfig couchdb on &> /dev/null
254
269
  $SERVICE_BIN rabbitmq-server start </dev/null &> /dev/null
255
270
  /sbin/chkconfig rabbitmq-server on &> /dev/null
271
+ sleep 3
272
+
273
+ local RABBIT_ERR_SIZE=$(stat -c%s "/var/log/rabbitmq/startup_err")
274
+ if (( $RABBIT_ERR_SIZE > 0 )); then
275
+ $SERVICE_BIN rabbitmq-server stop </dev/null &> /dev/null
276
+ $SERVICE_BIN rabbitmq-server start </dev/null &> /dev/null
277
+ sleep 3
278
+ fi
256
279
 
257
280
  # Chef 0.9: chef-solr chef-solr-indexer chef-server chef-server-webui
258
281
  # Chef 0.10: chef-solr chef-expander chef-server chef-server-webui
@@ -260,6 +283,7 @@ function start_chef_server {
260
283
  if [ -f /etc/init.d/$svc ]; then
261
284
  $SERVICE_BIN $svc start
262
285
  /sbin/chkconfig $svc on &> /dev/null
286
+ sleep 3
263
287
  fi
264
288
  done
265
289
  fi
@@ -177,6 +177,11 @@ namespace :chef do
177
177
  group=ServerGroup.fetch(:source => "cache")
178
178
  configs["ssh_gateway_ip"]=group.vpn_gateway_ip
179
179
 
180
+ json_config_file=ENV['JSON']
181
+ if not json_config_file.nil? then
182
+ configs["chef_json_file"] = json_config_file
183
+ end
184
+
180
185
  server_name=ENV['SERVER_NAME']
181
186
  if server_name.nil? then
182
187
  client_validation_key=ChefInstaller.install_chef_server(configs, group.os_types)
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: 47
4
+ hash: 45
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 8
9
- - 0
10
- version: 2.8.0
9
+ - 1
10
+ version: 2.8.1
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-11-08 00:00:00 -05:00
18
+ date: 2011-12-08 00:00:00 -05:00
19
19
  default_executable: chef-vpc-toolkit
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency