Skip to content

Instantly share code, notes, and snippets.

@Atalanta
Created April 11, 2011 17:38
Show Gist options
  • Save Atalanta/913910 to your computer and use it in GitHub Desktop.
Save Atalanta/913910 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "chef chef/chef_server_url string https://api.opscode.com/organizations/scee" | debconf-set-selections
echo "deb http://apt.opscode.com lucid main" > /etc/apt/sources.list.d/opscode.list
wget -O- http://apt.opscode.com/[email protected] | apt-key add -
apt-get update
apt-get install -y chef
echo "validation_client_name \"scee-validator\"" >> /etc/chef/client.rb
echo -e "sekrit key...." > /tmp/validation.pem
sed -i 's/ https:/https:/g' /etc/chef/client.rb
awk NF /tmp/validation.pem > /etc/chef/validation.pem
rm /tmp/validation.pem
echo "{
\"name\": \"base\",
\"default_attributes\": {
},
\"json_class\": \"Chef::Role\",
\"run_list\": [
\"recipe[apt]\",
\"recipe[users]\",
\"recipe[sudo]\",
\"recipe[git]\",
\"recipe[collectd::client]\"
],
\"description\": \"Base role that all machines get\",
\"chef_type\": \"role\",
\"override_attributes\": {
}
}">/etc/chef/first-boot.json
/usr/bin/chef-client -j /etc/chef/first-boot.json -l debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment