Created
September 11, 2012 13:26
-
-
Save jedi4ever/3698451 to your computer and use it in GitHub Desktop.
Puppet loop over hash and pass array of args to sysctl
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
Exec { path => '/usr/bin:/usr/sbin/:/bin:/sbin' } | |
$sysctl_settings = { | |
# On Hardware Node we generally need | |
# packet forwarding enabled and proxy arp disabled | |
"net.ipv4.ip_forward" => 1 , | |
"net.ipv6.conf.default.forwarding" => 1 , | |
"net.ipv6.conf.all.forwarding" => 1 , | |
"net.ipv4.conf.default.proxy_arp" => 0 , | |
# Enables source route verification | |
"net.ipv4.conf.all.rp_filter" => 1, | |
# Enables the magic-sysrq key | |
"kernel.sysrq" => 1, | |
# We do not want all our interfaces to send redirects | |
"net.ipv4.conf.default.send_redirects" => 1, | |
"net.ipv4.conf.all.send_redirects" => 0 | |
} | |
$keys = keys($sysctl_settings) | |
sysctl::value { $keys: | |
value => $sysctl_settings[$name], | |
require => Package['vzctl'] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Working version
$sysctl_settings = {
# On Hardware Node we generally need
# packet forwarding enabled and proxy arp disabled
"net.ipv4.ip_forward" => { value => 1 },
"net.ipv6.conf.default.forwarding" => { value => 1 },
"net.ipv6.conf.all.forwarding" => { value => 1 },
"net.ipv4.conf.default.proxy_arp" => { value => 0 },
}
$sysctl_defaults = {
require => Package['vzctl']
}
create_resources(sysctl::value , $sysctl_settings, $sysctl_defaults)
}