Cookbook version
2.7.0
Chef-client version
14.11.21
Platform Details
Ubuntu 18.04
Scenario:
Using firewall_rule in a custom resource results in exception Chef::Exceptions::ResourceNotFound
Chef::Exceptions::ResourceNotFound
----------------------------------
Cannot find a resource matching firewall[default] (did you define it first?)
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/firewall/libraries/provider_firewall_rule.rb:27:in `action_create'
Steps to Reproduce:
Create new cookbook with recipe default.rb:
fw 'Test fw' do
action :configure
end
and resource fw.rb:
resource_name :fw
action :configure do
firewall 'default' do
action :install
end
firewall_rule 'ssh' do
port 22
action :create
end
end
Add this cookbook to the runlist of a node.
Expected Result:
Firewall is installed, enabled and the rule is added.
Actual Result:
Using firewall_rule from a custom resource results in exception Chef::Exceptions::ResourceNotFound for firewall[default], error message see under Scenario.
Cookbook version
2.7.0
Chef-client version
14.11.21
Platform Details
Ubuntu 18.04
Scenario:
Using firewall_rule in a custom resource results in exception Chef::Exceptions::ResourceNotFound
Steps to Reproduce:
Create new cookbook with recipe default.rb:
and resource fw.rb:
Add this cookbook to the runlist of a node.
Expected Result:
Firewall is installed, enabled and the rule is added.
Actual Result:
Using firewall_rule from a custom resource results in exception Chef::Exceptions::ResourceNotFound for firewall[default], error message see under Scenario.