Installing Chef-Server / Chef-Client / Chef-Workstation

  • You can download CentOS from CentOS.org. (Free)
  • You can download Ubuntu MINT OS release from LinuxMint.com. (Free)
  • You can download the required .rpm (for CentOS) Chef-Server file from Chef.IO into “/home/ChefOS” folder. (Free)
  • You can download the required .deb (for Ubuntu Mint) Chef-Client file from Chef.IO into “/home/ChefOS” folder. (Free)
  • You can download the required .deb (for Ubuntu Mint) Chef Development Kit file from Chef.IO into “/home/ChefOS” folder. (Free)

My LAB

Installing Chef-Server on CentOS-7

How to check the CentOS Release? Release on my Lab is as below.

[[email protected] CentOS]# yum update

## After we install the CentOS properly, we can start installing Chef-Server using the correct file and version.
## .pem files will be created under “/etc/chef/” on Chef Server.
“chef-server-ctl user-create USERNAME FIRST_NAME [MIDDLE_NAME] LAST_NAME EMAIL PASSWORD –filename username-pem-file”
“chef-server-ctl org-create ORG_SHORT_NAME ORG_FULL_NAME –association-user USERNAME –filename orgname-validator.pem”

[[email protected] CentOS]# rpm -Uvh chef-server-core-12.15.8-1.el7.x86_64.rpm
[[email protected] CentOS]# chef-server-ctl reconfigure
[[email protected] CentOS]# chef-server-ctl user-create chefadmin ferdi bulbul [email protected] 123456! –filename chefadmin-pem-file
[[email protected] CentOS]# chef-server-ctl org-create chefadmins chef-administrators –association-user chefadmin –filename chefadmins-validator.pem

## You can check if the Chef-Server is running
[[email protected] CentOS]# chef-server-ctl status

## Install Management Console then you can access via “https://<Server_IP-ADDRESS>/login”
[[email protected] CentOS]# chef-server-ctl install chef-manage
[[email protected] CentOS]# chef-server-ctl reconfigure
[[email protected] CentOS]# chef-manage-ctl reconfigure
!
## If you can’t install Management Console using command above download the .rpm file from Chef.IO
[[email protected] CentOS]# rpm -Uvh chef-manage-2.5.4-1.el7.x86_64.rpm
[[email protected] CentOS]# chef-server-ctl reconfigure
[[email protected] CentOS]# chef-manage-ctl reconfigure
!
## If you still can’t access to the Management Console and you get the “Are you Looking for the Chef Server?” message as below, we must do some troubleshooting.

  • Check if NGINX is running,

  • If you are stuck at “END” output while running “chef-manage-ctl reconfigure” as below, exit using “q” not Ctrl+C.  Then accept the license with texting “yes”. You will be able to install Management Console properly.

  • Now, you can use your Management Console using the user account you created and associated with an organization.

Install Chef-Workstation on Ubuntu (MintOS)

How to check the Linux Ubuntu Release? Release on my Lab is as below.

## Install Chef Development Kit Debian Package
ferdi-ws Chef-OS # sudo dpkg -i chefdk-2.0.28-1_amd64.deb
ferdi-ws Chef-OS # ls /opt/chefdk      >> Verify if Chef DK is installed
ferdi-ws Chef-OS # chef verify           >> Runs verification for the components
!
## Change ruby location from “/home/bin” to “/opt/chefdk/embedded/bin/ruby” to use Chef DK ruby as default
ferdi-ws Chef-OS # which ruby          >> This will show /home/bin/
ferdi-ws Chef-OS # export PATH=”/opt/chefdk/embedded/bin:${HOME}/ .chefdk/gem/ruby/2.1.0/bin:$PATH”
!
!
## Download the Starter Kit from Chef Server Web Interface to a folder, my folder is “home/ferdi/Chef-OS”.
## If you have access to Chef server (hosted or on premises), you can download the starter kit. The starter kit will create the necessary configuration files—the .chef directory, knife.rb, the ORGANIZATION-validator.pem, and USER.pem files) with the correct information that is required to interact with the Chef server. Simply download the starter kit and then move it to the desired location on your workstation.

ferdi-ws # cd /home/ferdi/Chef-OS
ferdi-ws Chef-OS # sudo unzip chef-starter.zip
ferdi-ws Chef-OS # rm -rf chef-starter.zip    >> we dont need that .zip file anymore
## “chef-starter.zip” will unzip “chef-repo” folder as seen below. Chef-repo folder includes cookbook, roles, .chef and .gitignore folders. .chef folder includes the pem files for usernames and knife.rb file.

## Install GIT
ferdi-ws Chef-OS # sudo apt-get-install git
ferdi-ws Chef-OS # git clone https://github.com/chef/chef-repo.git
ferdi-ws Chef-OS # cd chef-repo
ferdi-ws Chef-OS # git init
ferdi-ws Chef-OS # git config –global user.name “USERNAME”
ferdi-ws Chef-OS # git config –global user.email “EMAIL”
ferdi-ws Chef-OS # echo “.chef” >> ~/chef-repo/.gitignore
ferdi-ws Chef-OS # cd ~/.chef-repo
ferdi-ws Chef-OS # git add .
ferdi-ws Chef-OS # git commit -m “Initial Commit”
!

Install Chef-Client on Ubuntu (MintOS)

How to check the Linux Ubuntu Release? Release on my Lab is as below.

## Run “knife bootstrap” command on Chef-Workstation
## “knife bootstrap <node-IP-address> -N <node-hostname> –ssh user <admin-user> –sudo”
ferdi-ws Chef-OS # knife bootstrap 192.168.220.136 -N chefclient.supereon.co.uk –ssh-user ferdi –sudo

Chef-Client is installed on node and we can see the node on Chef-Server Management Console as below.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

5 + 5 =