Chef
Upload the cookbook
From the bastion:
knife cookbook upload <insert cookbook name> -d
Troubleshooting the cookbook run
On the ec2 instance:
sudo chef-client -j /etc/chef/init.json
Troubleshooting steps:
- Failure can be confirmed by ssh’ing into bastion and running:
knife node list | grep <instance_id> - once in the node, run
sudo chef-client -j /etc/chef/init.jsonto pull the latest configuration/cookbook. Troubleshoot the error that comes up in the stacktrace when the
chef-clientruns and fix it to resolve the chef-client failure.
Alternatively:
sudo tail /var/log/chef/client.log
Chef Commands
To list the nodes:
knife node list
To display details of one node:
knife node show _node_name_
Chef Server Status
knife status
Chef Data Bags
knife data bag list
knife data bag show _bag_name_