Skip to content

Instantly share code, notes, and snippets.

@markbirbeck
Created November 30, 2011 11:22
Show Gist options
  • Save markbirbeck/1408747 to your computer and use it in GitHub Desktop.
Save markbirbeck/1408747 to your computer and use it in GitHub Desktop.
Bootstrapping Chef on CentOS
#!/bin/bash
#
# Get the EPEL repo.
#
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
#
# Install Chef.
#
rpm -Uvh http://download.elff.bravenet.com/5/i386/elff-release-5-3.noarch.rpm
yum -y --disablerepo=rightscale-epel install chef
gem install chef
#
# Configure Chef to point to Opscode
#
cat > /etc/chef/client.rb <<EOF
log_level :info
log_location STDOUT
chef_server_url "https://api.opscode.com/organizations/sidewinderlabs"
validation_client_name "sidewinderlabs-validator"
# Using default node name
EOF
#
# Add the Sidewinder Labs validation key.
#
cat > /etc/chef/validation.pem <<EOF
-----BEGIN RSA PRIVATE KEY-----
{insert key}
-----END RSA PRIVATE KEY-----
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment