Sha256: 53cdc525dd965dc122646ad9f462f7be4d198c38c576872ac00e0ce30208ba87

Contents?: true

Size: 1.67 KB

Versions: 31

Compression:

Stored size: 1.67 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

<% if client_pem -%>
cat > /etc/chef/client.pem <<'EOP'
<%= ::File.read(::File.expand_path(client_pem)) %>
EOP
chmod 0600 /etc/chef/client.pem
<% end -%>

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

<% 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 -%>

<% unless trusted_certs.empty? -%>
mkdir -p /etc/chef/trusted_certs
<%= trusted_certs %>
<% 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

31 entries across 31 versions & 1 rubygems

Version Path
chef-12.4.3-universal-mingw32 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.4.3 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.4.2-universal-mingw32 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.4.2 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.5.0.alpha.1 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.4.1-universal-mingw32 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.4.1 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.4.0 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.4.0-universal-mingw32 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.4.0.rc.2 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.4.0.rc.2-universal-mingw32 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.4.0.rc.0 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.4.0.rc.0-universal-mingw32 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.3.0-x86-mingw32 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.3.0 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.3.0.rc.0-x86-mingw32 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.3.0.rc.0 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.2.1-x86-mingw32 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.2.1 lib/chef/knife/bootstrap/templates/chef-aix.erb
chef-12.2.0.rc.2-x86-mingw32 lib/chef/knife/bootstrap/templates/chef-aix.erb