The Chef server acts as a hub for configuration data. The Chef server stores cookbooks, the policies that are applied to nodes, and metadata that describes each registered node that is being managed by the chef-client. Nodes use the chef-client to ask the Chef server for configuration details, such as recipes, templates, and file distributions. The chef-client then does as much of the configuration work as possible on the nodes themselves (and not on the Chef server). This scalable approach distributes the configuration effort throughout the organization.
The steps below describe the process for installing Chef Server 11.x.
To install Chef Server 11.x, do the following:
Click the Chef Server tab.
Select the operating system, version, and architecture.
Select the version of Chef Server 11.x to download, and then click the link that appears to download the package.
Install the downloaded package using the correct method for the operating system on which Chef Server 11.x will be installed.
Configure Chef Server 11.x by running the following command:
$ sudo chef-server-ctl reconfigure
This command will set up all of the required components, including Erchef, RabbitMQ, and PostgreSQL.
Verify the the hostname for the Chef server by running the hostname command. The hostname for the Chef server must be a FQDN.
Verify the installation of Chef Server 11.x by running the following command:
$ sudo chef-server-ctl test
This will run the chef-pedant test suite against the installed Chef Server 11.x and will report back that everything is working and installed correctly.
From the workstation, verify the install by running the following commands to ensure that every chef-client and user was registered correctly.
$ knife client list
$ knife user list
The hostname for the Chef server must meet the following requirements:
The api_fqdn setting can be added to the private-chef.rb file (it is not there by default). When added, its value should be equal to the FQDN for the service URI used by the Chef server. Then configure the same value for the bookshelf['vip'] setting prior to installing Enterprise Chef. For example: api_fqdn "chef.example.com".
To verify if a hostname is a FQDN
To verify if a hostname is a FQDN, run the following command:
If the hostname is a FQDN, it will return something like:
If the hostname is not a FQDN, it must be configured so that it is one.
To verify is a hostname is resolvable
To verify is a hostname is resolvable, run the following command:
$ hostname -f
If the hostname is resolvable, it will return something like:
To change a hostname
In some cases, the hostname for the Chef server needs to be updated. The process for updating a hostname varies, depending on the platform on which the Chef server will run. Refer to the manual for the platform or contact a local systems administrator for specific guidance for a specific platform. The following example shows how a hostname can be changed when running Red Hat or CentOS:
$ sudo hostname 'mychefserver.example.com'
$ echo "mychefserver.example.com" | sudo tee /etc/hostname
To add a hostname to /etc/hosts
If a hostname is not resolvable, refer to a local systems administrator for specific guidance on how to add the hostname to the DNS system. If the Chef server is being into a testing environment, just add the hostname to /etc/hosts. The following example shows how a hostname can be added to /etc/hosts when running Red Hat or CentOS:
$ echo -e "127.0.0.2 `hostname` `hostname -s`" | sudo tee -a /etc/hosts