How to Install Chef Server Workstation on ECS

Prerequisites

  • You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get $300 — $1200 worth in Alibaba Cloud credits for your new account. If you don’t k about how to setup your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 8GB RAM and 4 Core processor.
  • A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.
  • Domain name must be pointed to your Alibaba Cloud ECS’s IP address
  • Access to VNC console in your Alibaba Cloud or SSH client installed in your PC
  • Set up your server’s hostname and create user with root privileges.

Setting Up Your Server

# sudo apt update && sudo apt upgrade

Install Chef Server:

# wget https://packages.chef.io/files/stable/chef-server/12.17.33/ubuntu/16.04/chef-server-core_12.17.33-1_amd64.deb
# sudo dpkg -i chef-server-core_12.17.33-1_amd64.deb
# sudo rm chef-server-core_12.17.33-1_amd64.deb
# sudo chef-server-ctl reconfigure

Create a Chef User and Organization:

# mkdir .chef
# sudo chef-server-ctl user-create aareez Arslan Shafiq 123@example.com '654321Ab' --filename ~/.chef/aareez.pem
# sudo chef-server-ctl org-create org_name "org_full_name" --association_user aareez --filename ~/.chef/org_name.pem

Install Git:

# sudo apt update && sudo apt upgrade
# sudo apt-get install git
# git config --global user.name "Aareez"
# git config --global user.email "xyz@example.com"

Set Up Chef Workstations:

# wget https://packages.chef.io/files/stable/chefdk/3.3.23/ubuntu/16.04/chefdk_3.3.23-1_amd64.deb
# sudo dpkg -i chefdk_3.3.23-1_amd64.deb
# sudo rm chefdk_3.3.23-1_amd64.deb
# chef generate app chef-repo
# cd chef-repo
# mkdir .chef

Add RSA Private Keys

# scp aareez@softpedia.xyz:~/.chef/*.pem ~/chef-repo/.chef/
# ls ~/chef-repo/.chef

Set Up Version Control:

# echo ".chef" > .gitignore
# git status

Generate knife.rb:

# cd ~/chef-repo/.chef
# sudo nano knife.rb
current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name 'aareez'
client_key "aareez.pem"
validation_client_name 'org_name-validator'
validation_key "org_name-validator.pem"
chef_server_url 'https://softpedia.xyz/organizations/org_name'
cache_type 'BasicFile'
cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
cookbook_path ["#{current_dir}/../cookbooks"]
# cd ..
# knife ssl fetch
# knife client list

Bootstrap a Node:

# cd ~/chef-repo/.chef
# knife bootstrap softpedia.xyz -x aareez -P 654321Ab --sudo --node-name imaareez
# knife client list

Set Up Firewalls and Ports

Original Source

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Getting Hands-on with WinAppDriver Test Automation Framework

Encapsulation in Python

CS373 Spring 2020: Final Entry

Rabbit Vs Kafka

THM Windows Fundamentals Part 2

Strange Loop 2017 Conference Notes

Top Benefits (And Downsides) of Self-Hosted BI Software for Embedded Analytics

Yurbi - Self Hosted Embedded Analytics

What is the difference between Hard links and Symbolic links — Linux

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

Reduce the size of your Docker images with docker-slim

Deploying private repository

Migrating a Dockerized GitLab Chat bot to ARM Graviton2 in an afternoon

Version Control with Git