example42/puppet-firewall — pull request #13 by Freeaqingme (2013-10-12 15:36:10+00:00)
Title: Adding firewall_dns_info() and the ability to set a hostname as source/destination

The following two scenarios are now possible:
Implicit resolving:
firewall::rule { "name":
source => "$::fqdn",
destination => 'example42.com',
destination_v6 => [ 'example42.com', 'he.net' ],
protocol => $proto,
port => $port,
action => 'allow',
direction => 'output',
}

Explicit Resolving:
$dns_info = iptables_dns_info('www.gmail.com')

firewall { "name":
destination => $dns_info['ip_v4'],
destination_v6 => $dns_info['ip_v6'],
protocol => $proto,
port => $port,
action => 'allow',
direction => 'output',
resolve_locations => false,
enable => $dns_info['enable_v4'],
enable_v6 => $dns_info['enable_v6'],
}