knife-oca 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/chef/knife/bootstrap/debian6-apt.erb +64 -0
- data/lib/knife-oca/version.rb +1 -1
- metadata +3 -2
@@ -0,0 +1,64 @@
|
|
1
|
+
bash -c '
|
2
|
+
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
|
3
|
+
|
4
|
+
if [ ! -f /usr/bin/chef-client ]; then
|
5
|
+
apt-get install -y -q wget lsb-release
|
6
|
+
echo "chef chef/chef_server_url string <%= @chef_config[:chef_server_url] %>" | debconf-set-selections
|
7
|
+
[ -f /etc/apt/sources.list.d/opscode.list ] || echo "deb http://apt.opscode.com <%= chef_version.to_f >= 10 ? "`lsb_release -cs`-0.10" : "`lsb_release -cs`" %> main" > /etc/apt/sources.list.d/opscode.list
|
8
|
+
wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>-O- http://apt.opscode.com/packages@opscode.com.gpg.key | apt-key add -
|
9
|
+
fi
|
10
|
+
apt-get update -q
|
11
|
+
apt-get install -y -q chef
|
12
|
+
|
13
|
+
(
|
14
|
+
cat <<'EOP'
|
15
|
+
<%= validation_key %>
|
16
|
+
EOP
|
17
|
+
) > /tmp/validation.pem
|
18
|
+
awk NF /tmp/validation.pem > /etc/chef/validation.pem
|
19
|
+
rm /tmp/validation.pem
|
20
|
+
|
21
|
+
<% if @chef_config[:encrypted_data_bag_secret] -%>
|
22
|
+
(
|
23
|
+
cat <<'EOP'
|
24
|
+
<%= encrypted_data_bag_secret %>
|
25
|
+
EOP
|
26
|
+
) > /tmp/encrypted_data_bag_secret
|
27
|
+
awk NF /tmp/encrypted_data_bag_secret > /etc/chef/encrypted_data_bag_secret
|
28
|
+
rm /tmp/encrypted_data_bag_secret
|
29
|
+
<% end -%>
|
30
|
+
|
31
|
+
<%# Generate Ohai Hints -%>
|
32
|
+
<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
|
33
|
+
mkdir -p /etc/chef/ohai/hints
|
34
|
+
|
35
|
+
<% @chef_config[:knife][:hints].each do |name, hash| -%>
|
36
|
+
(
|
37
|
+
cat <<'EOP'
|
38
|
+
<%= hash.to_json %>
|
39
|
+
EOP
|
40
|
+
) > /etc/chef/ohai/hints/<%= name %>.json
|
41
|
+
<% end -%>
|
42
|
+
<% end -%>
|
43
|
+
|
44
|
+
<% unless @chef_config[:validation_client_name] == "chef-validator" -%>
|
45
|
+
[ `grep -qx "validation_client_name \"<%= @chef_config[:validation_client_name] %>\"" /etc/chef/client.rb` ] || echo "validation_client_name \"<%= @chef_config[:validation_client_name] %>\"" >> /etc/chef/client.rb
|
46
|
+
<% end -%>
|
47
|
+
|
48
|
+
<% if @config[:chef_node_name] %>
|
49
|
+
[ `grep -qx "node_name \"<%= @config[:chef_node_name] %>\"" /etc/chef/client.rb` ] || echo "node_name \"<%= @config[:chef_node_name] %>\"" >> /etc/chef/client.rb
|
50
|
+
<% end -%>
|
51
|
+
|
52
|
+
<% if knife_config[:bootstrap_proxy] %>
|
53
|
+
echo 'http_proxy "knife_config[:bootstrap_proxy]"' >> /etc/chef/client.rb
|
54
|
+
echo 'https_proxy "knife_config[:bootstrap_proxy]"' >> /etc/chef/client.rb
|
55
|
+
<% end -%>
|
56
|
+
|
57
|
+
(
|
58
|
+
cat <<'EOP'
|
59
|
+
<%= first_boot.to_json %>
|
60
|
+
EOP
|
61
|
+
) > /etc/chef/first-boot.json
|
62
|
+
|
63
|
+
echo "<%= start_chef %>"
|
64
|
+
<%= start_chef %>'
|
data/lib/knife-oca/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-oca
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fog
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- LICENSE
|
57
57
|
- README.rdoc
|
58
58
|
- knife-oca.gemspec
|
59
|
+
- lib/chef/knife/bootstrap/debian6-apt.erb
|
59
60
|
- lib/chef/knife/oca_base.rb
|
60
61
|
- lib/chef/knife/oca_server_delete.rb
|
61
62
|
- lib/chef/knife/oca_server_list.rb
|