Download and Install Chef in Amazon EC2 Linux Instance
In this article,we will see Download and Install Chef in Amazon EC2 Linux Instance.
Steps to follow Download and Install Chef
- Launch Linux EC2 Instance.
- Connect to Linux EC2 Instance through Putty.
- Switch to root user.
- Update Server Packages.
- Download and Install chef package.
- Verify chef package and Version.
Launch Linux EC2 Instance
Please check below link to Launch Linux Server.
We can see Linux Server “Chef-Workstation” which was created earlier.
Connect to Linux EC2 Instance through Putty
Open Linux EC2 Instance Terminal
1 2 3 4 5 6 7 8 9 |
Using username "ec2-user". Authenticating with public key "imported-openssh-key" Last login: Tue Dec 24 02:35:19 2019 from 124.123.103.5 __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ |
Switch to root user
1 2 3 |
[ec2-user@ip-172-31-42-243 ~]$ sudo su [root@ip-172-31-42-243 ec2-user]# |
Update Server Packages
By using “yum update” command.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
[root@ip-172-31-42-243 ec2-user]# yum update -y Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 2.4 kB 00:00:00 Resolving Dependencies --> Running transaction check ---> Package amazon-ssm-agent.x86_64 0:2.3.662.0-1.amzn2 will be updated ---> Package amazon-ssm-agent.x86_64 0:2.3.714.0-1.amzn2 will be an update ---> Package ca-certificates.noarch 0:2018.2.22-70.0.amzn2 will be updated Dependencies Resolved ================================================================================================ Package Arch Version Repository Size ================================================================================================ Installing: kernel x86_64 4.14.154-128.181.amzn2 amzn2-core 20 M python2-rpm x86_64 4.11.3-40.amzn2.0.3 amzn2-core 84 k replacing rpm-python.x86_64 4.11.3-25.amzn2.0.3 Updating: amazon-ssm-agent x86_64 2.3.714.0-1.amzn2 amzn2-core 15 M ca-certificates noarch 2018.2.22-70.0.amzn2.0.1 amzn2-core 392 k file x86_64 5.11-35.amzn2.0.2 amzn2-core 57 k Transaction Summary ================================================================================================ Install 2 Packages Upgrade 15 Packages Total download size: 49 M Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. (1/17): ca-certificates-2018.2.22-70.0.amzn2.0.1.noarch.rpm | 392 kB 00:00:00 (2/17): file-5.11-35.amzn2.0.2.x86_64.rpm | 57 kB 00:00:00 (3/17): file-libs-5.11-35.amzn2.0.2.x86_64.rpm | 339 kB 00:00:00 ------------------------------------------------------------------------------------------------ Total 52 MB/s | 49 MB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Updating : rpm-4.11.3-40.amzn2.0.3.x86_64 1/33 Updating : rpm-libs-4.11.3-40.amzn2.0.3.x86_64 2/33 Updating : python-libs-2.7.16-4.amzn2.x86_64 3/33 Updating : python-2.7.16-4.amzn2.x86_64 4/33 Updating : file-libs-5.11-35.amzn2.0.2.x86_64 5/33 Updating : rpm-build-libs-4.11.3-40.amzn2.0.3.x86_64 6/33 Verifying : libidn2-2.0.4-1.amzn2.0.2.x86_64 24/33 Verifying : rpm-libs-4.11.3-25.amzn2.0.3.x86_64 25/33 Installed: kernel.x86_64 0:4.14.154-128.181.amzn2 python2-rpm.x86_64 0:4.11.3-40.amzn2.0.3 Updated: amazon-ssm-agent.x86_64 0:2.3.714.0-1.amzn2 ca-certificates.noarch 0:2018.2.22-70.0.amzn2.0.1 file.x86_64 0:5.11-35.amzn2.0.2 file-libs.x86_64 0:5.11-35.amzn2.0.2 krb5-libs.x86_64 0:1.15.1-37.amzn2.2.1 rpm-plugin-systemd-inhibit.x86_64 0:4.11.3-40.amzn2.0.3 rsyslog.x86_64 0:8.24.0-41.amzn2.2.1 yum.noarch 0:3.4.3-158.amzn2.0.3 Replaced: rpm-python.x86_64 0:4.11.3-25.amzn2.0.3 Complete! |
Download and Install chef package
Download Chef Package
First we need to go chef official website by using below link.
Click on DOWNLOADS.
Click on Get it.
Copy Chef package URL from website
Paste URL which was copied from website in Linux EC2 Terminal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@ip-172-31-42-243 ec2-user]# wget https://packages.chef.io/files/stable/chef-workstation/0.13.35/el/7/chef-workstation-0.13.35-1.el7.x86_64.rpm --2019-12-24 01:56:37-- https://packages.chef.io/files/stable/chef-workstation/0.13.35/el/7/chef-workstation-0.13.35-1.el7.x86_64.rpm Resolving packages.chef.io (packages.chef.io)... 151.101.154.110 Connecting to packages.chef.io (packages.chef.io)|151.101.154.110|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 159970989 (153M) [application/x-rpm] Saving to: ‘chef-workstation-0.13.35-1.el7.x86_64.rpm’ 100%[======================================================>] 159,970,989 67.3MB/s in 2.3s 2019-12-24 01:56:39 (67.3 MB/s) - ‘chef-workstation-0.13.35-1.el7.x86_64.rpm’ saved [159970989/159970989] [root@ip-172-31-42-243 ec2-user]# ls chef-workstation-0.13.35-1.el7.x86_64.rpm |
The chef package has been downloaded successfully.
Install chef package
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
[root@ip-172-31-42-243 ec2-user]# yum install chef-workstation-0.13.35-1.el7.x86_64.rpm -y Loaded plugins: extras_suggestions, langpacks, priorities, update-motd Examining chef-workstation-0.13.35-1.el7.x86_64.rpm: chef-workstation-0.13.35-1.el7.x86_64 Marking chef-workstation-0.13.35-1.el7.x86_64.rpm to be installed Resolving Dependencies --> Running transaction check ---> Package chef-workstation.x86_64 0:0.13.35-1.el7 will be installed --> Finished Dependency Resolution amzn2-core/2/x86_64 | 2.4 kB 00:00:00 Dependencies Resolved ================================================================================================ Package Arch Version Repository Size ================================================================================================ Installing: chef-workstation x86_64 0.13.35-1.el7 /chef-workstation-0.13.35-1.el7.x86_64 722 M Transaction Summary ================================================================================================ Install 1 Package Total size: 722 M Installed size: 722 M Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : chef-workstation-0.13.35-1.el7.x86_64 1/1 To run the Chef Workstation App, use your platform's package manager to install these dependencies: libX11.so.6 => not found libX11-xcb.so.1 => not found libxcb.so.1 => not found libXcomposite.so.1 => not found libXcursor.so.1 => not found libatk-bridge-2.0.so.0 => not found libatspi.so.0 => not found libcups.so.2 => not found You can then launch the App by running 'chef-workstation-app'. The App will then be available in the system tray. Thank you for installing Chef Workstation! You can find some tips on getting started at https://chef.sh/ Verifying : chef-workstation-0.13.35-1.el7.x86_64 1/1 Installed: chef-workstation.x86_64 0:0.13.35-1.el7 Complete! |
Verify chef package and Version
Verify chef package
1 2 |
[root@ip-172-31-42-243 ec2-user]# which chef /bin/chef |
To see the version of Chef
using chef -v command
1 2 3 4 5 6 7 |
[root@ip-172-31-42-243 ec2-user]# chef -v Chef Workstation version: 0.13.35 Chef Infra Client version: 15.6.10 Chef InSpec version: 4.18.39 Chef CLI version: 2.0.0 Test Kitchen version: 2.3.4 Cookstyle version: 5.16.11 |
using chef -version command
1 2 3 4 5 6 7 |
[root@ip-172-31-42-243 ec2-user]# chef --version Chef Workstation version: 0.13.35 Chef Infra Client version: 15.6.10 Chef InSpec version: 4.18.39 Chef CLI version: 2.0.0 Test Kitchen version: 2.3.4 Cookstyle version: 5.16.11 |
Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates
KTEXPERTS is always active on below social media platforms.
Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts
Instagram : https://www.instagram.com/knowledgesharingplatform
pavan
Very use full content ..
every thing in step by step..
with proper screenshots..i am saving lot of time fallowing these steps and also did not face any errors.
thankq so much
priya
Never concentrated on DevOps until I followed this article. Worth the article. Waiting for more such articles.
Nayab
Very very nice effort. Really apppreciating. Hope Kt-experts do it more for the basic learners.
Thank you
santhi
Clean article. Very clearly explained. Keep it up!