Permalink
Browse files

Allow to use iptables rule templates from other cookbooks.

  • Loading branch information...
1 parent 1f9ef86 commit 145257327db37af09760f117206a671fbe6fce03 Ringo De Smet committed with jtimberman Jul 22, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 definitions/iptables_rule.rb
@@ -17,12 +17,13 @@
# limitations under the License.
#
-define :iptables_rule, :enable => true, :source => nil, :variables => {} do
+define :iptables_rule, :enable => true, :source => nil, :variables => {}, :cookbook => nil do
template_source = params[:source] ? params[:source] : "#{params[:name]}.erb"
template "/etc/iptables.d/#{params[:name]}" do
source template_source
mode 0644
+ cookbook params[:cookbook] if params[:cookbook]
variables params[:variables]
backup false
notifies :run, resources(:execute => "rebuild-iptables")

0 comments on commit 1452573

Please sign in to comment.