Open jewelnuruddin opened 4 years ago
Possible Solution 1
We can ignore "sysctl::base" because its create directory only,
file { '/etc/sysctl.d':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
# Magic hidden here
purge => $purge,
}
this directory is also ensure by "sysctl" class
file { "/etc/sysctl.d/${sysctl_d_file}":
ensure => $ensure,
owner => 'root',
group => 'root',
mode => '0644',
content => "${title} = ${value}\n",
}
Possible Solution 2
No big change on current settings, just comment out
#include sysctl::base
and call this from site.pp or nodes.pp or some other templates file for your convenient in my case I use like declare a basehost class
class basehost {
include sysctl::base
sysctl { "net.ipv4.tcp_max_syn_backlog" : value => '65535' }
sysctl { "net.core.somaxconn" : value => '65535' }
Its works for me and fulfill my purpose. It ensure every kernel settings hit first before services are run.
NOTE I mark this is an issue for an existing and complex puppet environment.
For various reason we need to tuning kernel value by sysctl, in our environment we found that some value are update after that related service up which is not effective until we manually restart that service again, manually restart is not convenient and often forget.
For example: Looking at the startup order of puppet, rmem has been set since td-agent was started. This caused a problem.
What we want to do We want to make sure that our kernel tuning value must be setup first before related services is up.
By Puppet resource Puppet already have some way to manage execution priority/order by "contain","require", "before", "notify"
By Puppet "Run Stages" There are some possibility to resolve this issue by using Run Stages
But this is not recommended until you know exactly what you want to do, and also have limitation Possible solution Puppet "Run Stages" settings can solve this problem though it have some limitation, Because of limitation current sysctl module need some little changes, this change will not effect existing users, it just a re-arrangement of declaration,
Here I attached an example of puppet graph
What if we use Run Stages with this current settings ?
Problem is dependency cycle as we use
inside sysctl/manifests/init.pp
Error is
This is happened because of limitation