KBEC-00293 - How to Set up a Chef Server and Workstation

Summary

This write-up includes steps to:

  • Install a Chef Server
  • Installing and setting up a Chef Workstation

Note that the installation scripts for the Server and Workstation are specific to Ubuntu 14.04 64-bit. For any other OS, a different installation file will need to be used, but the remaining steps should mostly be the same.

Installing and configuring the Chef Server:

Chef recommends having an FQDN for the Chef Server. If not available, there is a workaround where the workstation can connect to the server using its IP address.

Copy the script chef_server.sh to the ~/ directory and run as root. The script does the following:

  1. Downloads and installs the package for Chef Server version 12.0.0
  2. Configures and tests the installation
  3. Creates an admin user
  4. Creates a Chef organization
  5. Installs and configures Chef Manage (the web UI component of Chef Server)
  6. Generates 2 .pem (private SSH key) files: one for the admin user and another for the organization which is created

Saving files and accessing the web UI:

  • Save the 2 .pem files in a location from where they can be copied over to the workstation
  • Access the Chef Server UI by entering the URL of the server (either FQDN or IP address).
  • Click on “Click here to sign in” and login with the admin/changeme (set in the chef_server.sh script)
  • Download Knife config file:** click through Adminstration --> ec-org (or the name of the organization you created)** then on the left menu, click on “Generate Knife Config”
  • Save the downloaded knife.rb file along with the 2 .pem files to copy to the workstation
  • If you did not use an FQDN for the chef server, you will need to modify the chef_server_url property in the knife.rb file to use the IP address

Installing and setting up the Chef Workstatation:

If you have used vagrant to provision the workstation, you can copy over these 3 config files generated earlier:

  1. admin.pem
  2. ec-org-validator.pem
  3. knife.rb

The script chef_workstation.sh assumes these files are in the /vagrant directory, and it will have to be modified if the files are in a different location.

Copy the script chef_workstation.sh to the ~/ directory and run as root. The script does these:

  1. Downloads and installs Chef Development Kit version 0.3.5
  2. Installs Git
  3. Clones the chef-repo directories from Github
  4. Copies the 3 config files mentioned above to the appropriate directory (chef-repo/.chef)

At this point the workstation is ready to be used!

Please continue to KBEC-00294 for further instructions on usage of your Chef Server and Workstation

 

Written by Kishan Iyer

Have more questions? Submit a request

Comments

Powered by Zendesk