knife Quick Reference

Print Friendly and PDF
centos rhel nagios opensource monitoring

This is a quick reference for few of the commands which I use often.

Inital setup

knife ssl fetch
knife node list
knife bootstrap --node-name nagiosxi-test-linux --ssh-port 22 --ssh-user root --ssh-password nagiosxi@123 --sudo
knife bootstrap windows winrm --winrm-user 'Administrator' --winrm-password 'Nagios2234' --node-name nagiosxi_test_windows_client --winrm-ssl-verify-mode verify_none -V -y --run-list 'recipe[chef-client]'

Creating data bags

knife data bag create starter-databag cmadmin
knife data bag edit starter-databag cmadmin

Auto generate cookbook

chef generate cookbook <cookbook_name>
chef generate cookbook <cookbook_name> --copyright "Zubair AHMED" --email "" --license "mit"
chef generate attribute <attribute_file_name> --copyright "Zubair AHMED" --email "" --license "mit"
chef generate recipe <recipe_name> --copyright "Zubair AHMED" --email "" --license "mit"

Upload and Download cookbooks

knife cookbook upload <cookbook_name>
knife cookbook upload --all
knife cookbook site install <cookbook_name>
knife cookbook site search apache*
knife cookbook site show haproxy


kitchen create
kitchen converge
kitchen verify
kitchen destroy

Here is the complete reference.


Quick Reference

Written on August 26, 2016