Allow to configure sysctl values
This patch allows to customize sysctl values on all nodes, by defining the values in Hiera directly. Change-Id: Iab8b2f8559d6748f77630d68c48aebed90cf07ec
This commit is contained in:
parent
7040fc0943
commit
4435e1087f
@ -75,6 +75,19 @@
|
||||
# },
|
||||
# }
|
||||
#
|
||||
# [*sysctl*]
|
||||
# (optional) Set of sysctl values to set.
|
||||
# Defaults {}
|
||||
# Example:
|
||||
# {
|
||||
# 'net.ipv4.ip_forward' => {
|
||||
# 'value' => '1',
|
||||
# },
|
||||
# 'net.ipv6.conf.all.forwarding => {
|
||||
# 'value' => '1',
|
||||
# },
|
||||
# }
|
||||
#
|
||||
# [*manage_firewall*]
|
||||
# (optional) Completely enable or disable firewall settings
|
||||
# (false means disabled, and true means enabled)
|
||||
@ -110,6 +123,7 @@ class cloud(
|
||||
$selinux_booleans = [],
|
||||
$selinux_modules = [],
|
||||
$limits = {},
|
||||
$sysctl = {},
|
||||
$manage_firewall = false,
|
||||
$firewall_rules = {},
|
||||
$purge_firewall_rules = false,
|
||||
@ -161,6 +175,10 @@ This node is under the control of Puppet ${::puppetversion}.
|
||||
include ::limits
|
||||
create_resources('limits::limits', $limits)
|
||||
|
||||
# sysctl values
|
||||
include ::sysctl::base
|
||||
create_resources('sysctl::value', $sysctl)
|
||||
|
||||
# SELinux
|
||||
if $::osfamily == 'RedHat' {
|
||||
class {'cloud::selinux' :
|
||||
|
@ -64,6 +64,28 @@ describe 'cloud' do
|
||||
|
||||
end
|
||||
|
||||
context 'with explicit sysctl values' do
|
||||
before :each do
|
||||
params.merge!( :sysctl => {
|
||||
'net.ipv4.ip_forward' => {
|
||||
'value' => '1',
|
||||
},
|
||||
'net.ipv6.conf.all.forwarding' => {
|
||||
'value' => '1',
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
it { is_expected.to contain_sysctl('net.ipv4.ip_forward').with(
|
||||
:val => '1',
|
||||
) }
|
||||
it { is_expected.to contain_sysctl('net.ipv6.conf.all.forwarding').with(
|
||||
:val => '1',
|
||||
) }
|
||||
|
||||
end
|
||||
|
||||
|
||||
it {is_expected.to contain_file('/etc/motd').with(
|
||||
{:ensure => 'file'}.merge(file_defaults)
|
||||
)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user