Giter Club home page Giter Club logo

chef-iptables_persistent's People

Contributors

meineerde avatar yeah avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

chef-iptables_persistent's Issues

Error executing create on template[iptables-persistent_v4]

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.

apt-get -q -y install iptables-persistent=0.5.3ubuntu2 returned 100, expected 0

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

Add resources/providers to configure rules

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.