Last active
December 26, 2015 05:49
-
-
Save thcipriani/7103003 to your computer and use it in GitHub Desktop.
Chef Server Setup
This file contains hidden or 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
| Chef Server Setup | |
| ============= | |
| - Ubuntu 12.04 x86_64 (only other option is RHEL 5 or 6) | |
| - Hostname setup: | |
| echo "parabola" > /etc/hostname | |
| hostname -F /etc/hostname | |
| ```/etc/hosts | |
| 127.0.0.1 fqdn hostname localhost | |
| # (e.g., 127.0.0.1 parabola.tylercipriani.com parabola localhost) | |
| ``` | |
| - Setup Chef (info: http://www.opscode.com/blog/2013/03/11/chef-11-server-up-and-running/): | |
| ``` | |
| cd ~ | |
| wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef-server_11.0.8-1.ubuntu.12.04_amd64.deb | |
| sudo dpkg -i chef-server_11.0.8-1.ubuntu.12.04_amd64.deb | |
| sudo chef-server-ctl reconfigure | |
| ``` | |
| - Workstation setup | |
| [info](http://gettingstartedwithchef.com/introducing-chef-server.html) | |
| ``` | |
| mkdir ~/Development | |
| git clone git://github.com/opscode/chef-repo ~/Development/chef-repo | |
| cd ~/Development/chef-repo && mkdir .chef && cd .chef | |
| scp root@chef-server:/etc/chef-server/admin.pem ~/.chef | |
| scp root@chef-server:/etc/chef-server/chef-validator.pem ~/.chef | |
| knife configure -i | |
| ``` | |
| - Cookbook setup | |
| Add cookbooks to ~/Development/chef-repo/cookbooks | |
| upload via: | |
| knife cookbook upload --all -o ~/Development/chef-repo/cookbooks | |
| - Create New role | |
| export EDITOR=vim | |
| knife create role webserver | |
| add all your recipes to `run_list` | |
| :wq | |
| knife role list | |
| knife role show webserver -d -F json > ~/Development/chef-repo/roles/webserver.json | |
| knife role from file !$ | |
| - Launch new instance | |
| knife bootstrap --run-list "role[webserver]" --sudo --ssh-user ubuntu --identity-file <private-half-of-ssh-key> <ip-address-or-hostname> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment