我将使用云上的托管版Chef Server,当然也也可以使用物理机器,可以参考官方文档。托管版Chef Server的网址:manage.chef.io。
注册并登录,首次登录会要求创建一个组织,组织包含了一组机器,你将使用Chef服务器管理它们。
我们已经创建了一个名为qkg的组织,转到administration选项卡,我们需要把初学者工具包(starter kit)下载到工作站。这个初学者工具包将帮助你将文件从工作站推送到Chef服务器。
点击右侧的设置图标,点击初学者工具包:
下载初学者工具包:
下载后,把文件拷贝到工作站的/root目录下。解压此文件,可以看到它包含一个名为chef-repo的目录。
解压:
[root@qikegu ~]# unzip chef-starter.zip
Archive: chef-starter.zip
creating: chef-repo/cookbooks/
inflating: chef-repo/cookbooks/chefignore
creating: chef-repo/cookbooks/starter/
creating: chef-repo/cookbooks/starter/files/
creating: chef-repo/cookbooks/starter/files/default/
inflating: chef-repo/cookbooks/starter/files/default/sample.txt
inflating: chef-repo/cookbooks/starter/metadata.rb
creating: chef-repo/cookbooks/starter/attributes/
inflating: chef-repo/cookbooks/starter/attributes/default.rb
creating: chef-repo/cookbooks/starter/templates/
creating: chef-repo/cookbooks/starter/templates/default/
inflating: chef-repo/cookbooks/starter/templates/default/sample.erb
creating: chef-repo/cookbooks/starter/recipes/
inflating: chef-repo/cookbooks/starter/recipes/default.rb
inflating: chef-repo/README.md
inflating: chef-repo/.gitignore
creating: chef-repo/.chef/
creating: chef-repo/roles/
inflating: chef-repo/.chef/knife.rb
inflating: chef-repo/roles/starter.rb
inflating: chef-repo/.chef/kevinhwu.pem