Sha256: c990320310960a5952b0d85643bb7ecae71f9828dea37397339772729ac82930

Contents?: true

Size: 1.23 KB

Versions: 6

Compression:

Stored size: 1.23 KB

Contents

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

exists() {
  if command -v $1 &>/dev/null
  then
    return 0
  else
    return 1
  fi
}

install_sh="http://opscode.com/chef/install.sh"
version_string="<%= "-v #{knife_config[:bootstrap_version]}" if knife_config[:bootstrap_version] %>"

if ! exists /usr/bin/chef-client; then
  if exists wget; then
    bash <(wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %> ${install_sh} -O -) ${version_string}
  else
    if exists curl; then
      bash <(curl -L <%= "--proxy=on " if knife_config[:bootstrap_proxy] %> ${install_sh}) ${version_string}
    fi
  fi
fi

mkdir -p /etc/chef

(
cat <<'EOP'
<%= validation_key %>
EOP
) > /tmp/validation.pem
awk NF /tmp/validation.pem > /etc/chef/validation.pem
rm /tmp/validation.pem


<% if @chef_config[:encrypted_data_bag_secret] -%>
(
cat <<'EOP'
<%= encrypted_data_bag_secret %>
EOP
) > /tmp/encrypted_data_bag_secret
awk NF /tmp/encrypted_data_bag_secret > /etc/chef/encrypted_data_bag_secret
rm /tmp/encrypted_data_bag_secret
<% end -%>

(
cat <<'EOP'
<%= config_content %>
EOP
) > /etc/chef/client.rb

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

<%= start_chef %>'

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
chef-10.12.0.rc.1 lib/chef/knife/bootstrap/chef-full.erb
chef-0.10.10 lib/chef/knife/bootstrap/chef-full.erb
chef-0.10.10.rc.4 lib/chef/knife/bootstrap/chef-full.erb
chef-0.10.10.rc.3 lib/chef/knife/bootstrap/chef-full.erb
chef-0.10.10.rc.2 lib/chef/knife/bootstrap/chef-full.erb
chef-0.10.10.rc.1 lib/chef/knife/bootstrap/chef-full.erb