Skip to content

Instantly share code, notes, and snippets.

@woods
Created December 17, 2011 13:33
Show Gist options
  • Save woods/1490225 to your computer and use it in GitHub Desktop.
Save woods/1490225 to your computer and use it in GitHub Desktop.
Set up rackspace cloud server as chef server
#!/bin/bash
set -e # Exit on error
set -x # Print each command
# Set up the OpsCode repository
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | tee /etc/apt/sources.list.d/opscode.list
gpg --keyserver keys.gnupg.net --recv-keys 83EF826A
gpg --export [email protected] | tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg
apt-get update
apt-get install opscode-keyring
# Make sure existing software is up to date
apt-get upgrade
# Install chef server
apt-get install chef chef-server
# chef_server_url: http://chef.westarete.com:4000
# set rabbitmq password
# set admin password
# Create a normal user account and switch to that
groupadd -g 23987 woods
useradd -u 23987 -g woods -G admin -c "Scott Woods" -m woods
passwd woods
su - woods
# Install the required certificates for this user
mkdir -p ~/.chef
sudo cp /etc/chef/validation.pem /etc/chef/webui.pem ~/.chef
sudo chown -R woods ~/.chef
knife configure -i
# Overwrite /home/woods/.chef/knife.rb? (Y/N) y
# Please enter the chef server URL: [http://wert.westarete.com:4000]
# Please enter a clientname for the new client: [root] woods
# Please enter the existing admin clientname: [chef-webui]
# Please enter the location of the existing admin client's private key: [/etc/chef/webui.pem] /home/woods/.chef/webui.pem
# Please enter the validation clientname: [chef-validator]
# Please enter the location of the validation key: [/etc/chef/validation.pem] /home/woods/.chef/validation.pem
# Please enter the path to a chef repository (or leave blank):
# Creating initial API user...
# Created client[woods]
# Configuration file written to /home/woods/.chef/knife.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment