This is a quick reference for few of the commands which I use often.
Inital setup
knife ssl fetch
knife node list
knife bootstrap 172.2.2.34 --node-name nagiosxi-test-linux --ssh-port 22 --ssh-user root --ssh-password nagiosxi@123 --sudo
knife bootstrap windows winrm 172.22.2.222 --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
chef generate cookbook --copyright "Zubair AHMED" --email "zubayr@g.com" --license "mit"
chef generate attribute --copyright "Zubair AHMED" --email "zubayr@g.com" --license "mit"
chef generate recipe --copyright "Zubair AHMED" --email "zubayr@g.com" --license "mit"
Upload and Download cookbooks
knife cookbook upload
knife cookbook upload --all
knife cookbook site install
knife cookbook site search apache*
knife cookbook site show haproxy
Testing
kitchen create
kitchen converge
kitchen verify
kitchen destroy
Comments
Post a Comment