How to install Chef workstation on CentOS 7
To install Chef workstation on CentOS 7
A Chef workstation is a system, which we use to develop recipes and cookbooks and interact with a chef nodes. It helps in configuring organizational policy, including defining roles & environments and ensuring that critical data is being stored in data bags. The workstation is the location from which most users will do most of their work, including developing cookbooks and recipes (and authoring them using Ruby), keeping the chef-repo synchronized with version source control, using Knife to upload items from the chef-repo to the server, interacting with nodes, as (or when) required, such as performing a bootstrap operation. This tutorial covers the installation procedure of Chef workstation on CentOS 7.
Installation procedure
To start with the installation procedure, install the pre-requirement packages before installing Chef application. Execute the following command.
[root@linuxhelp11 Desktop]# yum install -y wget curl git
BDB2053 Freeing read locks for locker 0x3c91: 2296/139663582197568
BDB2053 Freeing read locks for locker 0x3c93: 2296/139663582197568
Loaded plugins: fastestmirror, langpacks
base | 3.6 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
extras/7/x86_64/primary_db | 191 kB 00:00
.
.
Dependency Updated:
libcurl.x86_64 0:7.29.0-35.el7.centos
Complete!
After installing the pre-required packages, download the Chefdk package from its official site by running the wget command followed by the download link.
[root@linuxhelp11 Desktop]# wget https://packages.chef.io/files/stable/chefdk/2.0.28/el/7/chefdk-2.0.28-1.el7.x86_64.rpm
--2017-09-01 23:30:47-- https://packages.chef.io/files/stable/chefdk/2.0.28/el/7/chefdk-2.0.28-1.el7.x86_64.rpm
Resolving packages.chef.io (packages.chef.io)... 151.101.128.65, 151.101.0.65, 151.101.192.65, ...
Connecting to packages.chef.io (packages.chef.io)|151.101.128.65|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 102628029 (98M) [application/x-rpm]
Saving to: ‘ chefdk-2.0.28-1.el7.x86_64.rpm’
100%[======================================> ] 102,628,029 1023KB/s in 1m 51s
2017-09-01 23:32:39 (901 KB/s) - ‘ chefdk-2.0.28-1.el7.x86_64.rpm’ saved [102628029/102628029]
The package is downloaded to the target system. Next install the chefdk by executing the rpm command.
[root@linuxhelp11 Desktop]# rpm -ivh chefdk-2.0.28-1.el7.x86_64.rpm
warning: chefdk-2.0.28-1.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:chefdk-2.0.28-1.el7 ################################# [100%]
Thank you for installing Chef Development Kit!
The Chef application is installed successfully in your system. You can also verify the ChefDK installation procedure by running the following command.
[root@linuxhelp11 Desktop]# chef verify
[WARN] This is an internal command used by the ChefDK development team. If you are a ChefDK user, please do not run it.
Running verification for component ' berkshelf'
Running verification for component ' test-kitchen'
Running verification for component ' tk-policyfile-provisioner'
Running verification for component ' chef-client'
Running verification for component ' chef-dk'
.
.
Verification of component ' generated-cookbooks-pass-chefspec' succeeded.
Verification of component ' chef-provisioning' succeeded.
Verification of component ' package installation' succeeded.
Installation is complete ,to check
You can also check the version of the installed chef application by executing the following command.
[root@linuxhelp11 Desktop]# chef --version
Chef Development Kit Version: 2.0.28
chef-client version: 13.2.20
delivery version: master (17c1b0fed9be4c70f69091a6d21a4cbf0df60a23)
berks version: 6.2.0
kitchen version: 1.16.0
inspec version: 1.31.1
The installation procedure of Chef is done successfully without any glitches.
# chef-server-ctl user-create admin Chef Administrator chef@linuxhelp.com Password -f ~/.chef/admin.pem