Home > Others > knife Quick Reference

knife Quick Reference

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

Here is the complete reference.

Quick Reference

from Blogger http://ift.tt/2bFbJm9
via IFTTT

Advertisements
Categories: Others Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: