复制代码
# knife node list
———————-———————-———————
node1
———————-———————-———————
从上面可以看出node1已经成功注册到了chef-server中,整个环境 chef-workstation => chef-server => chef-client-1 已经搭建成功。
八.登陆server web后台
1.修改浏览器本机HOST,这里笔者使用的是MAC系统
复制代码# vi /etc/hosts
———————-———————-———————
10.107.91.251 chef.example.com
10.107.91.252 node1.example.com
———————-———————-———————
2.访问https://chef.example.com
如图:



九.创建一个cookbook实例
1.git克隆chef repository (chef.example.com)
注: chef repository 是一个存储cookbooks和其他文件的目录结构,初次使用需要从github克隆
复制代码
# su -
# cd ~
# git clone git://github.com/opscode/chef-repo.git
———————————————————————————————————
Initialized empty Git repository in /root/chef-repo/.git/
remote: Reusing existing pack: 223, done.
remote: Total 223 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (223/223), 45.77 KiB | 37 KiB/s, done.
Resolving deltas: 100% (57/57), done.
———————————————————————————————————
获取到的目录如下:
复制代码
# ls
——————————————————————————————————
Desktop Downloads Pictures Templates anaconda-ks.cfg install.log src
Documents Music Public Videos chef-repo install.log.syslog
——————————————————————————————————










