Open Source Chef Server

by dagolden
5 deployments · 1 still active · last rev. 3 years ago

Upgrades the system, sets up the hostname, sets up root ssh key and disables password login, and installs the open source Chef Server.

Get the installer URL from here:

You must provide an SSH public key as password-based SSH login will be disabled after the script runs.

Hostname is based on reverse DNS, so you might want to set that before you run the stackscript.

Be sure to log in to the web interface and change the default admin password after install.

You may need to reboot after the system package upgrades.

Tested on Ubuntu 12.04 LTS. Might work on other Debian/Ubuntu systems.

Based on which has additional client-side setup instructions.

Compatible with: No distros currently supported
# <UDF name="installer_url" label="URL for Chef Server omnibus installer">
# <UDF name="root_publickey" label="SSH public key for root">

# get useful functions and goodies
source <ssinclude StackScriptID=1>

# Setup Hostname
get_rdns_primary_ip > /etc/hostname
service hostname start

# Don't prompt during installs
export DEBIAN_FRONTEND=noninteractive

# Install SSH key
mkdir /root/.ssh
echo $ROOT_PUBLICKEY > /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
chmod 700 /root/.ssh/

#Disable password login
sed -i 's/#.*PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
service ssh restart

# Install Chef server
wget -O chef-server.deb $INSTALLER_URL
dpkg -i chef-server.deb
chef-server-ctl reconfigure