Set up a chef server on debian with fabric
There are several ways documented on how to install a chef server. I'm lazy, I like python and I don't want to repeat myself. So I wrote this little script with fabric.
This script will:
- prepare the server for chef
- install chef
- install and configure nginx
- download the chef validation key
You can find the complete code at https://gist.github.com/4675413.
Preparations on your side
- Set up a VM or server with Debian (Ubuntu should work as well, but it's not tested).
- Add valid server certificates (
chef-api.crt
,chef-api.key
,chef.crt
,chef.key
) to the working directory.
Configuration Options
Change the environment variables according to your setup:
api.env.chef_api_prefix = 'chef-api'
api.env.chef_prefix = 'chef'
api.env.domain = 'yourdomain.com'
The default setup would generate a nginx config for:
- https://chef.yourdomain.com (web ui) and
- https://chef-api.yourdomain.com (chef api)
Run it!
fab deploy -H your_new_chef_host_ip
The script will also download the chef validation for you.
Written by Thomas Massmann
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#