我正在使用Chef
.
伯克斯文件
source "https://api.berkshelf.com"
cookbook 'firewall'
网站食谱/ufw/recipes/default.rb
firewall 'ufw'
firewall_rule 'http' do
port 80
end
firewall_rule 'https' do
port 443
end
网站食谱/ufw/metadata.rb
depends 'firewall'
节点/myserver.json
{
"run_list": [
"firewall",
"ufw"
]
}
knife solo cook myserver
最终出现如下错误:
Recipe: firewall::default
* firewall[default] action restart
================================================================================
Error executing action `restart` on resource 'firewall[default]'
================================================================================
NoMethodError
-------------
undefined method `include?' for :create:Symbol
Cookbook Trace:
---------------
/home/ironsand/chef-solo/cookbooks-3/firewall/libraries/provider_firewall_ufw.rb:67:in `block (2 levels) in <class:FirewallUfw>'
/home/ironsand/chef-solo/cookbooks-3/firewall/libraries/provider_firewall_ufw.rb:66:in `each'
/home/ironsand/chef-solo/cookbooks-3/firewall/libraries/provider_firewall_ufw.rb:66:in `block in <class:FirewallUfw>'
Resource Declaration:
---------------------
# In /home/ironsand/chef-solo/cookbooks-3/firewall/recipes/default.rb
22: firewall 'default' do
23: ipv6_enabled node['firewall']['ipv6_enabled']
24: action :install
25: end
26:
Compiled Resource:
------------------
# Declared in /home/ironsand/chef-solo/cookbooks-3/firewall/recipes/default.rb:22:in `from_file'
firewall("default") do
action [:install]
updated true
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :firewall
cookbook_name :firewall
recipe_name "default"
ipv6_enabled true
enabled true
rules {"ufw"=>{}}
end
我做错了什么?我该如何解决?