How to Install Chef Server Workstation on ECS

Prerequisites

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

--

--

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