From 5385f1326ff7a0cbe916871c3e9ba0bfa8b44704 Mon Sep 17 00:00:00 2001 From: Adam Henry Lewenberg <adamhl@stanford.edu> Date: Mon, 27 Jul 2015 13:30:25 -0700 Subject: [PATCH] include base::iptables to avoid error when running as puppet apply --- manifests/iptables.pp | 1 + manifests/iptables/rule.pp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/manifests/iptables.pp b/manifests/iptables.pp index 068b03f..a6f5319 100644 --- a/manifests/iptables.pp +++ b/manifests/iptables.pp @@ -8,6 +8,7 @@ class base::iptables { command => '/usr/sbin/rebuild-iptables', refreshonly => true, require => Package['stanford-server'], + path => '/usr/bin', unless => '[ -e /etc/no-iptables ]', } diff --git a/manifests/iptables/rule.pp b/manifests/iptables/rule.pp index d6f644f..07ce39c 100644 --- a/manifests/iptables/rule.pp +++ b/manifests/iptables/rule.pp @@ -17,7 +17,7 @@ # Multiple ports, multiple sources, and multiple protocols can be specified. # If only one is given, the [] brackets are optional. Description (optional) # is used to generate a comment at the top of the file and has no other -# semantic meaning. +# semantic meaning. # # Protocol is required. Source and port are optional; if omitted, connections # from any source or port are allowed. Omitting source AND port is not @@ -34,9 +34,12 @@ define base::iptables::rule( if ($source == '' and $port == '') { fail "Base::Iptables::Rule[$name] - you cannot omit both source and port" } + + include base::iptables + file { "/etc/iptables.d/${name}": ensure => $ensure, content => template('base/iptables/rule.erb'), notify => Exec['rebuild-iptables'], } -} \ No newline at end of file +} -- GitLab