planio-gmbh / chef-iptables_persistent Goto Github PK
View Code? Open in Web Editor NEWCreate iptables-persistent rules from roles
Create iptables-persistent rules from roles
Any ideas what's going wrong?
Recipe: iptables_persistent::default
* package[iptables] action install (up to date)
* package[iptables-persistent] action install (up to date)
* chef_gem[ipaddress] action install (up to date)
* directory[/etc/iptables] action create (up to date)
* template[iptables-persistent_v4] action create
================================================================================
Error executing action `create` on resource 'template[iptables-persistent_v4]'
================================================================================
Chef::Mixin::Template::TemplateError
------------------------------------
Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"'
Resource Declaration:
---------------------
# In /etc/chef/cookbooks-1/iptables_persistent/recipes/default.rb
31: template "iptables-persistent_#{version}" do
32: path "#{node["iptables_persistent"]["dir"]}/#{node["iptables_persistent"]["rules_#{version}"]}"
33: source "rules.erb"
34: owner "root"
35: group "root"
36: mode "0644"
37:
38: variables :protocol => "ip#{version}"
39: notifies :create, "ruby_block[restart iptables-persistent]", :immediately
40: end
41: end
Compiled Resource:
------------------
# Declared in /etc/chef/cookbooks-1/iptables_persistent/recipes/default.rb:31:in `block in from_file'
template("iptables-persistent_v4") do
provider Chef::Provider::Template
action "create"
retries 0
retry_delay 2
path "/etc/iptables/rules.v4"
backup 5
atomic_update true
source "rules.erb"
variables {:protocol=>"ipv4"}
cookbook_name :iptables_persistent
recipe_name "default"
mode "0644"
owner "root"
group "root"
end
Template Context:
-----------------
on line #22
20: <%- end %>
21:
22: <% rules(@protocol, table).each do |rule| -%>
23: <%= rule %>
24: <%- end %>
[2013-08-09T01:16:25+02:00] ERROR: Running exception handlers
[2013-08-09T01:16:25+02:00] ERROR: Exception handlers complete
[2013-08-09T01:16:25+02:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 3 resources updated
[2013-08-09T01:16:25+02:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
ERROR: RuntimeError: chef-solo failed. See output above.
Could it be that a include_recipe "apt"
in the iptables-persistent cookbook is necessary? I've got one in my cookbook that includes iptables_persistent but that doesn't help.
https://gist.github.com/lvnilesh/4039324
http://stackoverflow.com/questions/8937351/chef-isnt-running-the-apt-apt-get-update-recipe-apt-returns-100
http://garysieling.com/blog/fixing-error-apt-get-return-100-expected-0-chefvagrant
Recipe: iptables_persistent::default
* package[iptables] action install
- install version 1.4.12-1ubuntu5 of package iptables
* package[iptables-persistent] action install
================================================================================
Error executing action `install` on resource 'package[iptables-persistent]'
================================================================================
Chef::Exceptions::Exec
----------------------
apt-get -q -y install iptables-persistent=0.5.3ubuntu2 returned 100, expected 0
Resource Declaration:
---------------------
# In /etc/chef/cookbooks-1/iptables_persistent/recipes/default.rb
21: package "iptables-persistent"
22:
Compiled Resource:
------------------
# Declared in /etc/chef/cookbooks-1/iptables_persistent/recipes/default.rb:21:in `from_file'
package("iptables-persistent") do
action :install
retries 0
retry_delay 2
package_name "iptables-persistent"
version "0.5.3ubuntu2"
cookbook_name :iptables_persistent
recipe_name "default"
end
iptables rules should also be configureable using resources. That way, the rules could also be generated dynamically by wrapper cookbooks without hacks involving dynamic attributes.
The rules generated that way could be saved inside a node.run_state
hash and included in the generated templates similar to the attributes we have now.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.