覆盖Nginx cookbook默认\u启用的\u站点
我在尝试禁用Nginx中的覆盖Nginx cookbook默认\u启用的\u站点,nginx,chef-infra,Nginx,Chef Infra,我在尝试禁用Nginx中的default\u enabled\u站点时遇到了一些问题 # My Cookbook /cookbooks/my-server-book - /recipes/ - /attributes/ metadata.rb # Opscode Nginx /cookbooks/nginx 我已将覆盖['nginx']['enable_default_site']=false放入我的/cookbooks/my server book/attributes/default.r
default\u enabled\u站点时遇到了一些问题
# My Cookbook
/cookbooks/my-server-book
- /recipes/
- /attributes/
metadata.rb
# Opscode Nginx
/cookbooks/nginx
我已将覆盖['nginx']['enable_default_site']=false
放入我的/cookbooks/my server book/attributes/default.rb
文件中,但看起来nginx食谱正在覆盖我的更改
Recipe: nginx::commons_conf
* template[nginx.conf] action create (up to date)
* template[/etc/nginx/sites-available/default] action create (up to date)
* execute[nxdissite default] action run (skipped due to only_if)
任何见解我都将不胜感激
我在node.json文件中尝试了以下操作,但没有成功:
{
"nginx": {
"default_site_enabled": false
},
"run_list": ["recipe[main]"]
}
execute[nxDispatite default]
-这告诉您默认站点已被禁用(配置文件将始终被创建,但不会符号链接到当前启用的配置目录),因此您的覆盖似乎可以工作。感谢您让我知道如何使用execute[nxDispatite default]命令。这真的很有帮助。关于我的问题,我一开始运行chef solo,没有改变任何属性。这创建了000个默认虚拟主机文件,即使我更改了node.json或我的烹饪书的default.rb文件中的属性“default\u site\u enabled”,该文件也会保留在服务器上。我相信的原因是该文件已经创建,因此,在更改属性文件之前,需要先从/etc/nginx/sites enabled中删除或禁用默认值。