Sha256: 838d72cf8cdee560b2d6567768e63721bc8ced2e24564c32deda1c3f1cef7aa3

Contents?: true

Size: 1.99 KB

Versions: 28

Compression:

Stored size: 1.99 KB

Contents

bash -c '
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>

if [ ! -f /usr/bin/chef-client ]; then
  apt-get install -y wget
  echo "chef	chef/chef_server_url	string	<%= @chef_config[:chef_server_url] %>" | debconf-set-selections
  [ -f /etc/apt/sources.list.d/opscode.list ] || echo "deb http://apt.opscode.com <%= chef_version.to_f == 0.10 ? "lucid-0.10" : "lucid" %> main" > /etc/apt/sources.list.d/opscode.list
  wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>-O- http://apt.opscode.com/packages@opscode.com.gpg.key | apt-key add -
fi
apt-get update
apt-get install -y chef

cat > /etc/chef/validation.pem <<'EOP'
<%= validation_key %>
EOP
chmod 0600 /etc/chef/validation.pem

<% if @chef_config[:encrypted_data_bag_secret] -%>
cat > /etc/chef/encrypted_data_bag_secret <<'EOP'
<%= encrypted_data_bag_secret %>
EOP
chmod 0600 /etc/chef/encrypted_data_bag_secret
<% end -%>

<%# Generate Ohai Hints -%>
<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
mkdir -p /etc/chef/ohai/hints

<% @chef_config[:knife][:hints].each do |name, hash| -%>
cat > /etc/chef/ohai/hints/<%= name %>.json <<'EOP'
<%= hash.to_json %>
EOP
<% end -%>
<% end -%>

<% unless @chef_config[:validation_client_name] == "chef-validator" -%>
[  `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
<% end -%>

<% if @config[:chef_node_name] %>
[ `grep -qx "node_name \"<%= @config[:chef_node_name] %>\"" /etc/chef/client.rb` ] || echo "node_name \"<%= @config[:chef_node_name] %>\"" >> /etc/chef/client.rb
<% end -%>

<% if knife_config[:bootstrap_proxy] %>
echo 'http_proxy  "knife_config[:bootstrap_proxy]"' >> /etc/chef/client.rb
echo 'https_proxy "knife_config[:bootstrap_proxy]"' >> /etc/chef/client.rb
<% end -%>

cat > /etc/chef/first-boot.json <<'EOP'
<%= first_boot.to_json %>
EOP

<%= start_chef %>'

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
chef-10.30.0.rc.1-x86-mingw32 lib/chef/knife/bootstrap/ubuntu10.04-apt.erb
chef-10.30.0.rc.1 lib/chef/knife/bootstrap/ubuntu10.04-apt.erb
chef-10.30.0.rc.0 lib/chef/knife/bootstrap/ubuntu10.04-apt.erb
chef-10.30.0.rc.0-x86-mingw32 lib/chef/knife/bootstrap/ubuntu10.04-apt.erb
chef-10.28.2 lib/chef/knife/bootstrap/ubuntu10.04-apt.erb
chef-10.28.2-x86-mingw32 lib/chef/knife/bootstrap/ubuntu10.04-apt.erb
chef-10.28.0 lib/chef/knife/bootstrap/ubuntu10.04-apt.erb
chef-10.28.0.rc.0 lib/chef/knife/bootstrap/ubuntu10.04-apt.erb