我有一本厨师食谱(适用于apache2)。它无法在一个节点上工作。因此,我试图对其进行调整和更新,但是该节点似乎并未下载新版本。我已经能够使用将所有内容从本地计算机上载到Chef服务器knife upload .
,成功了,并打印出它已上载我更改的apache2菜谱位。
当我chef-client
在节点上手动运行(以root用户身份)时,可以看到它正在与服务器联系,获取运行列表等。但是其中的配方文件/var/cache/chef/cookbooks/apache2
是旧文件。配方失败(因为它没有我所做的更改)。
如何使节点上的Chef客户端使用apache2 Cookbook的新更新版本?我是否需要在食谱中添加版本号(我一直没有这样做)?
chef-client -l debug
输出:
[2015-01-30T10:51:31+01:00] DEBUG: Synchronizing cookbook apache2
[2015-01-30T10:51:31+01:00] DEBUG: Not storing cookbooks/apache2/recipes/mod_ldap.rb, as the cache is up to date.
[2015-01-30T10:51:31+01:00] DEBUG: Not storing cookbooks/apache2/recipes/mod_xsendfile.rb, as the cache is up to date.
[2015-01-30T10:51:31+01:00] DEBUG: Not storing cookbooks/apache2/recipes/mod_auth_openid.rb, as the cache is up to date.
[2015-01-30T10:51:31+01:00] DEBUG: Not storing cookbooks/apache2/recipes/mod_setenvif.rb, as the cache is up to date.
[2015-01-30T10:51:31+01:00] DEBUG: Not storing cookbooks/apache2/recipes/mod_python.rb, as the cache is up to date.
[2015-01-30T10:51:31+01:00] DEBUG: Not storing cookbooks/apache2/recipes/mod_authz_host.rb, as the cache is up to date.
[2015-01-30T10:51:31+01:00] DEBUG: Not storing cookbooks/apache2/recipes/mod_proxy_ajp.rb, as the cache is up to date.
[2015-01-30T10:51:31+01:00] DEBUG: Not storing cookbooks/apache2/recipes/mod_expires.rb, as the cache is up to date.
(lots of this for all files)
我是厨师的新手,所以我可能会犯一个初学者的错误。
knife cookbook upload <cookbook_name>
。如果仍不能解决问题,请尝试修改版本,然后运行knife cookbook list <cookbook_name>
以确保您确实正确上传了该版本。或者,运行knife cookbook download
(在另一个目录中)拉下服务器认为正确的代码。