Merge "Allow to configure sysctl values"
This commit is contained in:
commit
5e76243b08
@ -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*]
|
# [*manage_firewall*]
|
||||||
# (optional) Completely enable or disable firewall settings
|
# (optional) Completely enable or disable firewall settings
|
||||||
# (false means disabled, and true means enabled)
|
# (false means disabled, and true means enabled)
|
||||||
@ -110,6 +123,7 @@ class cloud(
|
|||||||
$selinux_booleans = [],
|
$selinux_booleans = [],
|
||||||
$selinux_modules = [],
|
$selinux_modules = [],
|
||||||
$limits = {},
|
$limits = {},
|
||||||
|
$sysctl = {},
|
||||||
$manage_firewall = false,
|
$manage_firewall = false,
|
||||||
$firewall_rules = {},
|
$firewall_rules = {},
|
||||||
$purge_firewall_rules = false,
|
$purge_firewall_rules = false,
|
||||||
@ -161,6 +175,10 @@ This node is under the control of Puppet ${::puppetversion}.
|
|||||||
include ::limits
|
include ::limits
|
||||||
create_resources('limits::limits', $limits)
|
create_resources('limits::limits', $limits)
|
||||||
|
|
||||||
|
# sysctl values
|
||||||
|
include ::sysctl::base
|
||||||
|
create_resources('sysctl::value', $sysctl)
|
||||||
|
|
||||||
# SELinux
|
# SELinux
|
||||||
if $::osfamily == 'RedHat' {
|
if $::osfamily == 'RedHat' {
|
||||||
class {'cloud::selinux' :
|
class {'cloud::selinux' :
|
||||||
|
@ -64,6 +64,28 @@ describe 'cloud' do
|
|||||||
|
|
||||||
end
|
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(
|
it {is_expected.to contain_file('/etc/motd').with(
|
||||||
{:ensure => 'file'}.merge(file_defaults)
|
{:ensure => 'file'}.merge(file_defaults)
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user