First you'll need to install Chef-Workstation on your laptop. This includes all the tools you need to use Chef.
https://downloads.chef.io/chef-workstation/0.17.5
Test your chef-workstation install with chef --version
command.
Chef Workstation version: 0.7.4
Chef Infra Client version: 15.1.36
Chef InSpec version: 4.7.3
Test Kitchen version: 2.2.5
Foodcritic version: 16.1.1
Cookstyle version: 5.0.0
Chef-Workstation includes the knife
command line, which lets you interface with Chef-Server.
Add a config file at.chef/config.rb
.
You'll need to set the following:
chef_server_url, the FQDN to your chef-serve with /organizations/org-name
Mine was demo-org
.
client_key, Full path to your client key no ~/
this was created in step 5--filename /tmp/ericc.pem
when you created your user on the Chef-Server
node name, this is the username you created ericc
chef_server_url 'https://FQDNgoesHERE.com/organizations/demo-org'
client_key '/Full/PathGoesHere/.chef/ericc.pem'
node_name 'ericc'
We need to grab the self-signed cert & add it to .chef/trusted_certs
knife ssl fetch
Now we can validate the Cert is valid
knife ssl check
Connecting to host FQDN:443
Successfully verified certificates from `FQDN
You can also confirm the user we created earlier.
knife user list
ericc