From: Jan Vansteenkiste <jan@vstone.eu> Date: Wed, 22 Aug 2012 15:14:57 +0000 (+0200) Subject: Use host_to_mask so we can negate a mask. Also added documentation. X-Git-Tag: 0.5.0~18^2~10 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=7ec314ee5915b5576742ffa59586eccff59308be;p=puppet-modules%2Fpuppetlabs-firewall.git Use host_to_mask so we can negate a mask. Also added documentation. A custom provider should probably be aware that these kind of masks are possible. --- diff --git a/lib/puppet/type/firewall.rb b/lib/puppet/type/firewall.rb index f887194..ec14e7f 100644 --- a/lib/puppet/type/firewall.rb +++ b/lib/puppet/type/firewall.rb @@ -107,12 +107,16 @@ Puppet::Type.newtype(:firewall) do source => '192.168.2.0/24' + You can also negate a mask by putting ! in front. For example: + + source => '! 192.168.2.0/24' + The source can also be an IPv6 address if your provider supports it. EOS munge do |value| begin - @resource.host_to_ip(value) + @resource.host_to_mask(value) rescue Exception => e self.fail("host_to_ip failed for #{value}, exception #{e}") end @@ -138,12 +142,16 @@ Puppet::Type.newtype(:firewall) do destination => '192.168.1.0/24' + You can also negate a mask by putting ! in front. For example: + + destination => '! 192.168.2.0/24' + The destination can also be an IPv6 address if your provider supports it. EOS munge do |value| begin - @resource.host_to_ip(value) + @resource.host_to_mask(value) rescue Exception => e self.fail("host_to_ip failed for #{value}, exception #{e}") end