Sha256: 45c7204ae682dd39e19a1254d61ba64be6789dde2f342910bafeb3af2490e47a

Contents?: true

Size: 1.38 KB

Versions: 6

Compression:

Stored size: 1.38 KB

Contents

ksh -c '

function exists {
  if type $1 >/dev/null 2>&1
  then
    return 0
  else
    return 1
  fi
}

if ! exists /usr/bin/chef-client; then
  <% if @chef_config[:aix_package] -%>
    # Read the download URL/location from knife.rb with option aix_package
    rm -rf /tmp/chef_installer # ensure there no older pkg
    echo "<%= @chef_config[:aix_package] %>"
    perl -e '\''use LWP::Simple; getprint($ARGV[0]);'\'' <%= @chef_config[:aix_package] %> > /tmp/chef_installer
    installp -aYF -d  /tmp/chef_installer chef
  <% else -%>
     echo ":aix_package location is not set in knife.rb"
     exit
  <% end -%>
fi

mkdir -p /etc/chef

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

<% if 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'
<%= Chef::JSONCompat.to_json(hash) %>
EOP
<% end -%>
<% end -%>

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

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

<%= start_chef %>'

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
chef-11.18.12-x86-mingw32 lib/chef/knife/bootstrap/chef-aix.erb
chef-11.18.12 lib/chef/knife/bootstrap/chef-aix.erb
chef-11.18.6-x86-mingw32 lib/chef/knife/bootstrap/chef-aix.erb
chef-11.18.6 lib/chef/knife/bootstrap/chef-aix.erb
chef-11.18.0-x86-mingw32 lib/chef/knife/bootstrap/chef-aix.erb
chef-11.18.0 lib/chef/knife/bootstrap/chef-aix.erb