anchor.diff:      exit 1
     fi
   }
  -
  -temp_dir="<%= Dir.mktmpdir %>"
  -<% if node['chef-server-image']['package_url'] %>
  -  if ! exists /usr/bin/chef-server-ctl; then
  -    echo "Installing Chef Server..."
  -    pkg_url="<%= node['chef-server-image']['package_url'] %>"
  -    if exists wget; then
  -      wget ${pkg_url} -O ${temp_dir}/chef-server-pkg --no-check-certificate
  -    elif exists curl; then
  -      curl -L ${pkg_url} -o ${temp_dir}/chef-server-pkg
  -    else
  -      echo "Neither wget nor curl found. Please install one and try again." >&2
  -      exit 1
  -    fi
  -    sudo dpkg -i $temp_dir/chef-server-pkg
  -    checkStatus "Chef-Server Package installation failed..."
  -  fi
  -<% else %>
  -  version="<%= node['chef-server-image']['package_version'] %>"
  -  name="<%= node['chef-server-image']['package_name'] %>"
  -  sudo apt-get install $name=$version
  -<% end %>
  -
  -sudo chef-server-ctl reconfigure
  -
  -sudo mkdir /etc/chef-server
  -
  -cat > /etc/chef-server/chef-server.rb <<'EOP'
  -
  -topology "standalone"
  -
  -api_fqdn "<%= node['chef-server']['api_fqdn'] %>"
  -
  -<% node['chef-server']['configuration'].each_pair do |component, tunables| -%>
  -<% case tunables -%>
  -<% when Hash -%>
  -<% tunables.each_pair do |name, value| -%>
  -<% value = %Q["#{value}"] if value.kind_of?(String) -%>
  -<%= "#{component.gsub("-","_")}['#{name}'] = #{value}" %>
  -<% end -%>
  -<% when String -%>
  -<%= component.gsub('-', '_') %> "<%= tunables %>"
  -<% end -%>
  -<% end -%>
  -EOP
   
   ## Take chef server configuration from user
   while getopts ":u:f:l:e:p:o:F:" opt; do
  
positive.code:   usage
  fi
  
  sudo chef-server-ctl reconfigure
  
  ## Create user
  
negative.code: checkStatus "Error: Chef-Server organization creation fails. Please try again"
  echo "New organization created for chef-server. RSA private key for organization stored at: /etc/chef-server/$orgShortName-validator.pem"
  
  echo "Successfully Installed Chef Server v12.0 !!!"
  echo "USER NAME = ${user}"
  echo "PASSWORD = ${password}"
  echo "ORGANIZATION = ${orgShortName}"
  echo "USER PRIVATE_KEY = /etc/chef-server/$user.pem"
  echo "ORGANIZATION PRIVATE_KEY = /etc/chef-server/$orgShortName-validator.pem"
  