Chef - 没有名为 windows_http_acl 的资源或方法
Chef - no resource or method named windows_http_acl
我正在尝试在我的一本食谱中使用 windows_http_acl
lwrp。
当我尝试使用它时,出现此错误。
================================================================================
Recipe Compile Error in c:/chef/cache/cookbooks/foo/recipes/bar.rb
================================================================================
NoMethodError
-------------
No resource or method named `windows_http_acl' for `Chef::Recipe "bar"'
Cookbook Trace:
---------------
c:/chef/cache/cookbooks/foo/recipes/bar.rb:26:in `from_file'
Relevant File Content:
----------------------
c:/chef/cache/cookbooks/foo/recipes/bar.rb:
26>> windows_http_acl 'http://+:8080/' do
27: user "#{node['domain']}\foobar"
28: end
29:
我的模块metadata.rb
....
depends 'windows', '~> 1.37.0'
depends 'iis', '~> 4.1.1'
depends 'chef_handler'
比较 opscode/windows metadata.rb
我的 Berksfile
source "https://supermarket.chef.io"
metadata
cookbook 'windows', git: 'https://github.com/opscode-cookbooks/windows.git'
cookbook 'iis', git: 'https://github.com/opscode-cookbooks/iis.git'
我的默认食谱
include_recipe 'windows'
include_recipe 'foo::bar'
我试过 运行 带有调试功能的 chef 客户端,遗憾的是它没有显示任何信息。
我什至尝试过 fork opscode/windows 食谱并在 metadata.rb 文件中添加 'provides windows_http_acl' 语句。
version '1.37.0'
supports 'windows'
source_url "https://github.com/opscode-cookbooks/windows"
issues_url "https://github.com/opscode-cookbooks/windows/issues"
depends 'chef_handler'
provides 'windows_http_acl'
什么可能导致我的食谱无法找到 windows_http_acl 资源?我对厨师很陌生,所以也许我缺少一些简单的东西。
更新
我已尝试删除 berksfile.lock 以确保它没有旧版本
DEPENDENCIES
foo
path: .
metadata: true
iis
git: https://github.com/opscode-cookbooks/iis.git
revision: 58fffd8eb30ac34cc99672995e12289556a4a074
windows
git: https://github.com/opscode-cookbooks/windows.git
revision: b469294f7581863f8d76f8b0c0fbfb5dc2617983
GRAPH
foo(0.x.x)
chef_handler (>= 0.0.0)
iis (~> 4.1.1)
windows (~> 1.37.0)
chef_handler (1.1.9)
iis (4.1.1)
windows (>= 1.34.6)
windows (1.37.0)
chef_handler (>= 0.0.0)
正如 coderanger 在 IRC 上指出的那样。 运行 以下命令显示我的 Chef 服务器中没有该资源。
knife cookbook show windows 1.37.0 providers
我删除了食谱并重新上传,现在列出了 http_acl.rb 资源。
knife cookbook delete windows
rm Berksfile.lock && berks install && berks upload
比其他答案更正确的版本是
berks upload windows --force --no-freeze
这将强制上传,即使您可能在之前的上传中冻结了它。这是 运行 预发行版食谱的普遍问题。
我正在尝试在我的一本食谱中使用 windows_http_acl
lwrp。
当我尝试使用它时,出现此错误。
================================================================================
Recipe Compile Error in c:/chef/cache/cookbooks/foo/recipes/bar.rb
================================================================================
NoMethodError
-------------
No resource or method named `windows_http_acl' for `Chef::Recipe "bar"'
Cookbook Trace:
---------------
c:/chef/cache/cookbooks/foo/recipes/bar.rb:26:in `from_file'
Relevant File Content:
----------------------
c:/chef/cache/cookbooks/foo/recipes/bar.rb:
26>> windows_http_acl 'http://+:8080/' do
27: user "#{node['domain']}\foobar"
28: end
29:
我的模块metadata.rb
....
depends 'windows', '~> 1.37.0'
depends 'iis', '~> 4.1.1'
depends 'chef_handler'
比较 opscode/windows metadata.rb
我的 Berksfile
source "https://supermarket.chef.io"
metadata
cookbook 'windows', git: 'https://github.com/opscode-cookbooks/windows.git'
cookbook 'iis', git: 'https://github.com/opscode-cookbooks/iis.git'
我的默认食谱
include_recipe 'windows'
include_recipe 'foo::bar'
我试过 运行 带有调试功能的 chef 客户端,遗憾的是它没有显示任何信息。
我什至尝试过 fork opscode/windows 食谱并在 metadata.rb 文件中添加 'provides windows_http_acl' 语句。
version '1.37.0'
supports 'windows'
source_url "https://github.com/opscode-cookbooks/windows"
issues_url "https://github.com/opscode-cookbooks/windows/issues"
depends 'chef_handler'
provides 'windows_http_acl'
什么可能导致我的食谱无法找到 windows_http_acl 资源?我对厨师很陌生,所以也许我缺少一些简单的东西。
更新
我已尝试删除 berksfile.lock 以确保它没有旧版本
DEPENDENCIES
foo
path: .
metadata: true
iis
git: https://github.com/opscode-cookbooks/iis.git
revision: 58fffd8eb30ac34cc99672995e12289556a4a074
windows
git: https://github.com/opscode-cookbooks/windows.git
revision: b469294f7581863f8d76f8b0c0fbfb5dc2617983
GRAPH
foo(0.x.x)
chef_handler (>= 0.0.0)
iis (~> 4.1.1)
windows (~> 1.37.0)
chef_handler (1.1.9)
iis (4.1.1)
windows (>= 1.34.6)
windows (1.37.0)
chef_handler (>= 0.0.0)
正如 coderanger 在 IRC 上指出的那样。 运行 以下命令显示我的 Chef 服务器中没有该资源。
knife cookbook show windows 1.37.0 providers
我删除了食谱并重新上传,现在列出了 http_acl.rb 资源。
knife cookbook delete windows
rm Berksfile.lock && berks install && berks upload
比其他答案更正确的版本是
berks upload windows --force --no-freeze
这将强制上传,即使您可能在之前的上传中冻结了它。这是 运行 预发行版食谱的普遍问题。