Created
March 19, 2009 09:36
-
-
Save jsierles/81677 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# EC2 bootstrap | |
# | |
export PATH=$PATH:/usr/local/bin | |
mkdir /etc/chef | |
mkdir /var/chef | |
cat > /etc/chef/solo.rb <<SOLO | |
cookbook_path "/var/chef/cookbooks" | |
node_path "/var/chef/nodes" | |
log_level :info | |
file_store_path "/var/chef" | |
file_cache_path "/var/chef" | |
SOLO | |
cat > /etc/chef/bootstrap.json <<BOOTSTRAP | |
{"assigned_hostname": "<%= @hostname %>", | |
"assigned_domain": "<%= @domain %>", | |
"public_fqdn": "<%= @public_fqdn %>", | |
"role": "<%= @role %>", | |
"recipes": ["ec2"] | |
} | |
BOOTSTRAP | |
cat > /etc/chef/init.json <<INIT | |
{"role": "<%= @role %>", | |
"recipes": ["ddclient", "base", "chef::client"], | |
"public_fqdn": "<%= @public_fqdn %>" | |
} | |
INIT | |
echo <%= @validation_token %> > /etc/chef/validation_token | |
cat > /etc/ec2/resolv.conf <<DNS | |
search <%= @domain %> | |
nameserver <%= @primary_nameserver_ip %> | |
DNS | |
cp /etc/ec2/resolv.conf /etc/resolv.conf | |
wget -P /tmp http://dist/ruby-enterprise_1.8.6-20090201_i386.deb | |
dpkg -i /tmp/ruby-enterprise_1.8.6-20090201_i386.deb | |
gem sources -a http://gems | |
gem sources -a http://gems.opscode.com | |
gem install chef --no-rdoc --no-ri | |
apt-get update | |
chef-solo -j /etc/chef/bootstrap.json -r http://dist/cookbooks.tgz | |
chef-solo -j /etc/chef/init.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment