How to Install Chef on ubuntu 16.04

To Install Chef on ubuntu 16.04

Chef is a free and open source configuration management tool. It is written in Ruby and Erlang. Chef can easily integrate with cloud-based platforms such as AWS, OpenStack, or RackSpace, etc to automatically create and manage the servers. When an organization grows and the number of nodes increases, it becomes difficult for a system administrator to manage each node by himself.in this scenario chef comes to rescue.

 

Installing Chef

Before you begin the process of installation, make sure you update the repository by making use of the following command. 

root@linuxhelp:~# apt-get update
Hit:1 http://old-releases.ubuntu.com/ubuntu zesty InRelease
Hit:2 http://old-releases.ubuntu.com/ubuntu zesty-updates InRelease
Hit:3 http://old-releases.ubuntu.com/ubuntu zesty-security InRelease
Reading package lists... Done

 

Chef requires a resolvable hostname set on the server. The hostname must be an FQDN or Full Qualified Domain Name, for example,  chef.linuxhelp.com To set the hostname on your server, run the following command.

root@linuxhelp:~# hostname " chef.linuxhelp.com" 

 

And then, you need to replace chef.yourdomain.com with your actual domain name. Also,   you need to update the hostname in /etc/hostname file.

root@linuxhelp:~# vim /etc/hosts
And then, add the IP address of your hostname in /etc/hosts file. 
192.168.7.233  chef.linuxhelp.com 
You should replace 198.168.7.233 with your actual public IP address

 


Once it is done, you need to setup NTP of Network Time Protocol server is required to sync the dock of the server. 

root@linuxhelp:~# apt install ntp
Reading package lists... Done
Building dependency tree       
.
.
Processing triggers for systemd (232-21ubuntu2) ...

 

Once it is done, you need to start NTP by running the following command.

root@linuxhelp:~# systemctl start ntp

 

To enable NTP to automatically start at boot time, run the following command.

root@linuxhelp:~# systemctl enable ntp

 

Now, you shall download Chef Server package for Ubuntu by running the wget command in the following manner. 

root@linuxhelp:~# 
wget https://packages.chef.io/files/stable/chef-server/12.15.8/ubuntu/16.04/chef-server-core_12.15.8-1_amd64.deb


Once it is done, you need to install the package by running the following command.

root@linuxhelp:~# dpkg -i chef-server-core_12.15.8-1_amd64.deb
Selecting previously unselected package chef-server-core.
(Reading database ... 173609 files and directories currently installed.)
Preparing to unpack chef-server-core_12.15.8-1_amd64.deb ...
Unpacking chef-server-core (12.15.8-1) ...
Setting up chef-server-core (12.15.8-1) ...

 

Chef is now installed on your system. The configuration of chef will be updated in an upcoming tutorial. 

FAQ
Q
What is chef workstation?
A
A workstation is a computer running the Chef Development Kit (Chef DK) that is used to author cookbooks, interact with the Chef server, and interact with nodes. The workstation is where users do most of their work, including: Developing and testing cookbooks and recipes.
Q
How to create admin account for chef?
A
use the following command to create admin account for chef
# chef-server-ctl user-create admin Chef Administrator chef@linuxhelp.com Password -f ~/.chef/admin.pem
Q
What is chef what for it is used?
A
Chef is a free and open source configuration management tool.
It is written in Ruby and Erlang. Chef can easily integrate with cloud-based
platforms such as AWS, OpenStack, or RackSpace, et
Q
Whether Chef is paid service?
A
No, chef is free and open source software.
Q
How to manage web console for chef ?
A
execute the command as follow to manage web console of chef "chef-server-ctl install chef-manage".