Created
October 6, 2014 13:25
-
-
Save grafjo/c908dd632442b1743833 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reverse lookup | |
lala=<%= scope.function_foobar(['192.168.0.0/24']) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Puppet::Parser::Functions | |
newfunction(:foobar, :type => :rvalue) do |args| | |
require 'ipaddr_extensions' | |
return IPAddr.new(args[0]).reverses[0] | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define dnsmasq::dns::reverse ( | |
$upstream_server, | |
$source_address = undef, | |
) { | |
$netmask = $title | |
package { 'ipaddr_extensions': | |
ensure => installed, | |
provider => gem, | |
} | |
file {'/etc/dnsmasq.d/foobar.conf': | |
content => template('dnsmasq/dns.conf.reverse.erb'), | |
require => Package['ipaddr_extensions'], | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment