Skip to content

Instantly share code, notes, and snippets.

@pochi
Last active August 29, 2015 14:07
Show Gist options
  • Save pochi/962caaa17a4b879feeb3 to your computer and use it in GitHub Desktop.
Save pochi/962caaa17a4b879feeb3 to your computer and use it in GitHub Desktop.
Chef(v: 11.16.4) Description

Description

Chefをv0.10.4のころからさわっていないので最新版で使って変更点がどの変にあるのかまとめておきたい。

Create default file

pochi >>> knife configure                                                                                                      WARNING: No knife configuration file found
Where should I put the config file? [/Users/itp/.chef/knife.rb] 
Please enter the chef server URL: [https://itpurodhusubu-no-macbook-pro.local:443] 
Please enter an existing username or clientname for the API: [itp] 
Please enter the validation clientname: [chef-validator] 
Please enter the location of the validation key: [/etc/chef-server/chef-validator.pem] 
Please enter the path to a chef repository (or leave blank): 
*****

You must place your client key in:
  /Users/itp/.chef/itp.pem
Before running commands with Knife!

*****

You must place your validation key in:
  /etc/chef-server/chef-validator.pem
Before generating instance data with Knife!

*****
Configuration file written to /Users/itp/.chef/knife.rb
knife configure  3.84s user 0.83s system 21% cpu 22.061 total
pochi >>>      

Config cookbooks path

log_level                :info
log_location             STDOUT
node_name                'itp'
client_key               '/Users/itp/.chef/itp.pem'
validation_client_name   'chef-validator'
validation_key           '/etc/chef-server/chef-validator.pem'
chef_server_url          'https://itpurodhusubu-no-macbook-pro.local:443'
syntax_check_cache_path  '/Users/itp/.chef/syntax_check_cache'
cookbook_path            '/opt/local/repos/cookbooks'

How to create cookbook

pochi >>> knife cookbook create kafka
WARNING: No knife configuration file found
** Creating cookbook kafka
** Creating README for cookbook: kafka
** Creating CHANGELOG for cookbook: kafka
** Creating metadata for cookbook: kafka
knife cookbook create kafka --cookbook-path /opt/local/repos/cookbooks/kafka  3.25s user 0.41s system 99% cpu 3.673 total
pochi >>> ls
kafka
pochi >>> cd kafka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment