cluster_chef-knife 3.0.12 → 3.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +24 -0
- data/Gemfile +3 -2
- data/README.md +5 -1
- data/Rakefile +11 -4
- data/VERSION +1 -1
- data/cluster_chef-knife.gemspec +8 -6
- data/config/ubuntu10.04-cluster_chef.erb +157 -0
- data/config/ubuntu11.10-cluster_chef.erb +145 -0
- data/ironfan.gemspec +123 -0
- data/lib/chef/knife/bootstrap/ubuntu10.04-cluster_chef.erb +40 -22
- data/lib/chef/knife/bootstrap/ubuntu11.10-cluster_chef.erb +26 -14
- data/lib/chef/knife/cluster_kick.rb +8 -0
- data/lib/chef/knife/cluster_kill.rb +2 -2
- data/lib/chef/knife/cluster_proxy.rb +16 -10
- data/lib/chef/knife/cluster_show.rb +5 -0
- data/lib/chef/knife/cluster_ssh.rb +49 -2
- data/lib/chef/knife/cluster_start.rb +8 -0
- data/lib/chef/knife/cluster_stop.rb +7 -1
- data/lib/chef/knife/cluster_sync.rb +2 -2
- data/lib/chef/knife/knife_common.rb +3 -6
- metadata +83 -82
- data/clusters/website_demo.rb +0 -65
- data/lib/chef/knife/bootstrap/ubuntu10.04-basic.erb +0 -78
@@ -1,78 +0,0 @@
|
|
1
|
-
bash -c '
|
2
|
-
|
3
|
-
# This is the ubuntu-10.04-gems script from opscode, but it installs the chef-client service and kicks off the first run of chef
|
4
|
-
|
5
|
-
set -v
|
6
|
-
|
7
|
-
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
|
8
|
-
eval `cat /etc/lsb-release `
|
9
|
-
export DEBIAN_FRONTEND=noninteractive
|
10
|
-
|
11
|
-
if [ ! -f /usr/bin/chef-client ]; then
|
12
|
-
apt-get update
|
13
|
-
apt-get install -y ruby ruby1.8-dev build-essential wget libruby-extras libruby1.8-extras
|
14
|
-
cd /tmp
|
15
|
-
wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.tgz
|
16
|
-
tar zxf rubygems-1.6.2.tgz
|
17
|
-
cd rubygems-1.6.2
|
18
|
-
ruby setup.rb --no-format-executable
|
19
|
-
fi
|
20
|
-
|
21
|
-
gem update --no-rdoc --no-ri
|
22
|
-
gem install ohai --no-rdoc --no-ri --verbose
|
23
|
-
gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %>
|
24
|
-
|
25
|
-
echo -e "`date` \n\n**** \n**** Knifing in the chef client config files:\n****\n"
|
26
|
-
mkdir -p /etc/chef
|
27
|
-
|
28
|
-
(
|
29
|
-
cat <<'EOP'
|
30
|
-
<%= validation_key %>
|
31
|
-
EOP
|
32
|
-
) > /tmp/validation.pem
|
33
|
-
awk NF /tmp/validation.pem > /etc/chef/validation.pem
|
34
|
-
rm /tmp/validation.pem
|
35
|
-
|
36
|
-
echo -e "`date` \n\n**** \n**** Creating chef client script:\n****\n"
|
37
|
-
|
38
|
-
(
|
39
|
-
cat <<'EOP'
|
40
|
-
<%= config_content %>
|
41
|
-
EOP
|
42
|
-
) > /etc/chef/client.rb
|
43
|
-
|
44
|
-
(
|
45
|
-
cat <<'EOP'
|
46
|
-
<%= { "run_list" => @run_list, "cluster_name" => @config[:node].cluster_name, "facet_name" => @config[:node].facet_name, "facet_index" => @config[:node].facet_index }.to_json %>
|
47
|
-
EOP
|
48
|
-
) > /etc/chef/first-boot.json
|
49
|
-
|
50
|
-
echo -e "`date` \n\n**** \n**** Adding chef client runit scripts:\n****\n"
|
51
|
-
service chef-client stop 2>/dev/null ; sleep 1 ; killall chef-client 2>/dev/null
|
52
|
-
mkdir -p /var/log/chef /var/chef /etc/sv/chef-client/log/main /etc/sv/chef-client/supervise
|
53
|
-
cat > /etc/sv/chef-client/log/run <<EOF
|
54
|
-
#!/bin/bash
|
55
|
-
exec svlogd -tt ./main
|
56
|
-
EOF
|
57
|
-
cat > /etc/sv/chef-client/run <<EOF
|
58
|
-
#!/bin/bash
|
59
|
-
exec 2>&1
|
60
|
-
exec /usr/bin/env chef-client -i 43200 -s 20 -L /var/log/chef/client.log
|
61
|
-
EOF
|
62
|
-
chmod +x /etc/sv/chef-client/log/run /etc/sv/chef-client/run
|
63
|
-
ln -nfs /usr/bin/sv /etc/init.d/chef-client
|
64
|
-
|
65
|
-
<%- if (@config[:bootstrap_runs_chef_client].to_s == 'true') || (@chef_config.knife[:bootstrap_runs_chef_client].to_s == 'true') %>
|
66
|
-
echo -e "`date` \n\n**** \n**** First run of chef:\n****\n"
|
67
|
-
<%= start_chef %>
|
68
|
-
<%- end %>
|
69
|
-
|
70
|
-
echo -e "`date` \n\n**** \n**** Cleanup:\n****\n"
|
71
|
-
updatedb
|
72
|
-
|
73
|
-
echo -e "`date` \n\n**** \n**** Enabling chef client service:\n****\n"
|
74
|
-
ln -nfs /etc/sv/chef-client /etc/service/chef-client
|
75
|
-
service chef-client start
|
76
|
-
|
77
|
-
echo -e "`date` \n\n**** \n**** Cluster Chef client bootstrap complete\n****\n"
|
78
|
-
'
|