chef, knife-solo installation

First step to install chef.

env memo

Centos 7

1
2
ruby -v
ruby 2.0.0p598 (2014-11-13) [x86_64-linux]

ref

http://learn.chef.io/learn-the-basics/rhel/
http://tsuchikazu.net/chef_solo_start/
http://qiita.com/TsuyoshiUshio@github/items/89030baca68b05a9783d

chef installation

If you use proxy -p option is required

gem -i chef –no-ri –no-rdoc -p http://yourproxy:8080

1
2
3
4
gem list | grep chef
chef (12.4.1)
chef-config (12.4.1)
chef-zero (4.2.3)

knife configuration

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
knife configure
WARNING: No knife configuration file found
Where should I put the config file? [/root/.chef/knife.rb]
Please enter the chef server URL: [https://localhost:443]
Please enter an existing username or clientname for the API: [root]
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:
/root/.chef/root.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 /root/.chef/knife.rb

All setting are left as default.

knife-solo installation

1
2
3
4
5
6
7
8
9
10
11
12
13
Fetching: knife-solo-0.4.2.gem (100%)
Thanks for installing knife-solo!

If you run into any issues please let us know at:
https://github.com/matschaffer/knife-solo/issues

If you are upgrading knife-solo please uninstall any old versions by
running `gem clean knife-solo` to avoid any errors.

See http://bit.ly/CHEF-3255 for more information on the knife bug
that causes this.
Successfully installed knife-solo-0.4.2
1 gem installed

creating repository

1
2
3
4
5
6
7
knife solo init chef-repo
Creating kitchen...
Creating knife.rb in kitchen...
Creating cupboards...

ls chef-repo/
cookbooks data_bags environments nodes roles site-cookbooks

chef login setting

1
2
vi /root/.chef/root.pem
chmod 600 /root/.chef/root.pem

downloading cookbook

1
2
3
4
5
6
gem i berkshelf --no-ri --no-rdoc
vi Berksfile

site :opscode
cookbook 'yum'
cookbook 'nginx'
1
berks vendor cookbooks

To be continued…