stemcell 0.6.1 → 0.6.2a

Sign up to get free protection for your applications and to get access to all the features.
data/examples/stemcellrc CHANGED
@@ -21,8 +21,8 @@ CHEF_ENVIRONMENT=default
21
21
  export LOCAL_CHEF_ROOT=/path/to/your/local/chef/repository
22
22
 
23
23
  # The git origin is the publically-accessible version of the
24
- # local chef root; we use a github enterprise server
25
- export GIT_ORIGIN=git@git.airbnb.com:airbnb/chef.git
24
+ # local chef root
25
+ export GIT_ORIGIN=git@github.com:airbnb/chef.git
26
26
 
27
27
  # The git branch to use by default
28
28
  export GIT_BRANCH=production
@@ -94,6 +94,8 @@ module Stemcell
94
94
  'created_by' => opts.fetch('user', ENV['USER']),
95
95
  'stemcell' => VERSION,
96
96
  }
97
+ # Short name if we're in production
98
+ tags['Name'] = opts['chef_role'] if opts['chef_environment'] == 'production'
97
99
  tags.merge!(opts['tags']) if opts['tags']
98
100
 
99
101
  # generate launch options
@@ -18,39 +18,12 @@ if [ $UID != 0 ]; then
18
18
  exit 1
19
19
  fi
20
20
 
21
- ## Only run once at a time
22
- # http://stackoverflow.com/questions/959475/shell-fragment-to-make-sure-only-one-instance-a-shell-script-runs-at-any-given-t
23
- # slightly modified to use $$
24
- # to run it I must set +e
25
-
26
- SCRIPTNAME=`basename $0`
27
- PIDFILE=/var/run/${SCRIPTNAME}.pid
28
-
29
- set +e
30
- if [ -f ${PIDFILE} ]; then
31
- #verify if the process is actually still running under this pid
32
- OLDPID=`cat ${PIDFILE}`
33
- RESULT=`ps -ef | grep ${OLDPID} | grep ${SCRIPTNAME}`
34
-
35
- if [ -n "${RESULT}" ]; then
36
- echo "Script already running! Exiting"
37
- exit 255
38
- fi
39
-
40
- fi
41
- ### ---
42
- set -e
43
-
44
21
 
45
22
  # redirect stdout to /var/log/init
46
- exec > /var/log/init
23
+ exec >> /var/log/init
47
24
 
48
25
  # redirect stderr to /var/log/init.err
49
- exec 2> /var/log/init.err
50
-
51
- #grab pid of this process and update the pid file with it
52
- echo $$ > ${PIDFILE}
53
-
26
+ exec 2>> /var/log/init.err
54
27
 
55
28
 
56
29
  ##
@@ -67,6 +40,8 @@ git_key='<%= opts['git_key'] %>'
67
40
  data_bag_secret='<%= opts["chef_data_bag_secret"] %>'
68
41
  hostname='<%= opts['instance_hostname'] %>'
69
42
  domain_name='<%= opts['instance_domain_name'] %>'
43
+ chef_version='<%= opts['chef_version'] %>'
44
+ package_url="<%= opts['chef_package_source'] %>"
70
45
 
71
46
 
72
47
  ##
@@ -110,20 +85,20 @@ set_hostname() {
110
85
  }
111
86
 
112
87
  install_chef() {
113
- chef_version=<%= opts['chef_version'] %>
114
- platform=`lsb_release -s -i | tr '[:upper:]' '[:lower:]'`
115
- platform_version=`lsb_release -s -r`
116
- arch=`uname -m`
117
- package_url="<%= opts['chef_package_source'] %>"
118
-
119
- package_local="/tmp/chef_${chef_version}.deb"
120
- echo "Downloading chef from $package_url"
121
- wget $package_url -O $package_local
122
-
123
- echo "Installing chef $chef_version"
124
- dpkg -i $package_local
125
-
126
- rm $package_local
88
+ # check to see if chef is already installed
89
+ if ! which chef-solo > /dev/null ; then
90
+ platform=`lsb_release -s -i | tr '[:upper:]' '[:lower:]'`
91
+ platform_version=`lsb_release -s -r`
92
+ arch=`uname -m`
93
+ package_local="/tmp/chef_${chef_version}.deb"
94
+ echo "Downloading chef from $package_url"
95
+ wget $package_url -O $package_local
96
+ echo "Installing chef $chef_version"
97
+ dpkg -i $package_local
98
+ rm $package_local
99
+ else
100
+ echo chef is already installed
101
+ fi
127
102
  }
128
103
 
129
104
  update_repo() {
@@ -269,10 +244,4 @@ configure_chef_daemon
269
244
  ##
270
245
 
271
246
 
272
- if [ -f ${PIDFILE} ]; then
273
- rm ${PIDFILE}
274
- fi
275
- # I can delete the cron too
276
- rm -f /etc/cron.d/ec2admin_get_callback1
277
-
278
247
  echo "<%= last_bootstrap_line %>"
@@ -1,3 +1,3 @@
1
1
  module Stemcell
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2a"
3
3
  end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stemcell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
5
- prerelease:
4
+ version: 0.6.2a
5
+ prerelease: 5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Martin Rhoads
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-11-19 00:00:00.000000000 Z
15
+ date: 2014-01-08 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: aws-sdk
@@ -200,9 +200,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
200
  required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  none: false
202
202
  requirements:
203
- - - ! '>='
203
+ - - ! '>'
204
204
  - !ruby/object:Gem::Version
205
- version: '0'
205
+ version: 1.3.1
206
206
  requirements: []
207
207
  rubyforge_project:
208
208
  rubygems_version: 1.8.23