anchor.diff:      zlib \
       zlib-devel
   
  -if [ ! -d runit-rpm ]; then git clone https://github.com/imeyer/runit-rpm.git; fi
  -cd runit-rpm
  -./build.sh
  -yum install --assumeyes /root/rpmbuild/RPMS/x86_64/runit-*.rpm || true # TODO: Remove this shim
  -cd -
  +# Grr, prevent 'prelink' from mangling our binaries
  +# http://www.tsheffler.com/blog/?p=491
  +grep ruby /etc/prelink.conf || echo '-b /usr/bin/ruby*' >>/etc/prelink.conf
  +
  +print_header "Installing ruby version ${RUBY_VERSION}"
  +yum install --assumeyes ruby-1.9.3.p545
   
   yum clean all
   
   if [ ! -f /usr/bin/chef-client ]; then
   
  -  # Grr, prevent 'prelink' from mangling our binaries
  -  # http://www.tsheffler.com/blog/?p=491
  -  grep ruby /etc/prelink.conf || echo '-b /usr/bin/ruby*' >>/etc/prelink.conf
  -
  -  echo -e "`date` \n\n**** \n**** Installing ruby version ${RUBY_VERSION}:\n****\n"
  -
  -  wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-${RUBY_VERSION}.tar.gz
  -  tar xf ruby-${RUBY_VERSION}.tar.gz
  -  cd ruby-${RUBY_VERSION}
  -  ./configure --prefix=/usr --enable-shared --disable-install-doc --with-opt-dir=/usr/lib64 --with-openssl-dir=/usr/include/openssl
  -  make
  -  make install
  -
  -  echo -e "`date` \n\n**** \n**** Updating rubygems:\n****\n"
  +  print_header "Updating gems"
     gem update --system
   
  -  echo -e "`date` \n\n**** \n**** Installing chef:\n****\n"
  +  print_header "Installing chef"
     gem install ohai --no-rdoc --no-ri
     gem install chef --no-rdoc --no-ri --version "$CHEF_VERSION"
     # gems needed for the client.rb or so generically useful you want them at hand
     gem install      --no-rdoc --no-ri extlib bundler json right_aws pry fog
   
   else # no chef-client
  -  echo -e "`date` \n\n**** \n**** Chef is present -- skipping apt/ruby/chef installation\n****\n"
  +  print_header "Chef is present -- skipping apt/ruby/chef installation"
   fi # end ruby+chef install
   
  -echo -e "`date` \n\n**** \n**** Knifing in the chef client config files:\n****\n"
  +print_header "Writing chef client config files"
   mkdir -p /etc/chef
   
   <%- if @config[:client_key] %>
  
positive.code: chmod +x /etc/init.d/chef-client-nonce 
  chkconfig --level 2345 chef-client-nonce on
  
  echo -e "`date` \n\n**** \n**** Ensure 'user' user has sudo:\n****\n"
  sed -i -e 's/name: root/name: user/' \
    -e '/name: user/a \
      groups: [wheel]' /etc/cloud/cloud.cfg
  sed -i -e 's/# \(%wheel.*NOPASSWD.*\)/\1/' /etc/sudoers
  
  echo -e "`date` \n\n**** \n**** Disable iptables postfix:\n****\n"
  for svc in iptables ip6tables postfix; do
      service $svc stop
      chkconfig --level 2345 $svc off
  done
  
  echo -e "`date` \n\n**** \n**** Disable SELinux:\n****\n"
  sed -i -e 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
  
  echo -e "`date` \n\n**** \n**** Cluster Chef client bootstrap complete\n****\n"
  EOF
  
negative.code: rm /tmp/encrypted_data_bag_secret
  <% end -%>
  
  print_header "Deleting temp files"
  cd /tmp
  rm -rf /tmp/knife-bootstrap
  
  print_header "Creating chef client script"
  
  (
  cat <<'EOP'
  