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 +2 -2
- data/lib/stemcell/launcher.rb +2 -0
- data/lib/stemcell/templates/bootstrap.sh.erb +18 -49
- data/lib/stemcell/version.rb +1 -1
- metadata +5 -5
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
|
25
|
-
export GIT_ORIGIN=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
|
data/lib/stemcell/launcher.rb
CHANGED
@@ -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
|
23
|
+
exec >> /var/log/init
|
47
24
|
|
48
25
|
# redirect stderr to /var/log/init.err
|
49
|
-
exec 2
|
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
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
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 %>"
|
data/lib/stemcell/version.rb
CHANGED
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.
|
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:
|
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:
|
205
|
+
version: 1.3.1
|
206
206
|
requirements: []
|
207
207
|
rubyforge_project:
|
208
208
|
rubygems_version: 1.8.23
|