mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
puppet: Factor out a sysctl operator.
This commit is contained in:
committed by
Tim Abbott
parent
cd58655a4b
commit
588aec96f9
@@ -190,20 +190,9 @@ class zulip::app_frontend_base {
|
||||
content => template('zulip/uwsgi.ini.template.erb'),
|
||||
notify => Service[$zulip::common::supervisor_service],
|
||||
}
|
||||
file { '/etc/sysctl.d/40-uwsgi.conf':
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
content => template('zulip/sysctl.d/40-uwsgi.conf.erb'),
|
||||
}
|
||||
exec { 'sysctl_p_uwsgi':
|
||||
command => '/sbin/sysctl -p /etc/sysctl.d/40-uwsgi.conf',
|
||||
subscribe => File['/etc/sysctl.d/40-uwsgi.conf'],
|
||||
refreshonly => true,
|
||||
# We have to protect against running in Docker and other
|
||||
# containerization which prevents adjusting these.
|
||||
onlyif => 'touch /proc/sys/net/core/somaxconn',
|
||||
zulip::sysctl { 'uwsgi':
|
||||
content => template('zulip/sysctl.d/40-uwsgi.conf.erb'),
|
||||
skip_docker => true,
|
||||
}
|
||||
|
||||
file { [
|
||||
|
||||
25
puppet/zulip/manifests/sysctl.pp
Normal file
25
puppet/zulip/manifests/sysctl.pp
Normal file
@@ -0,0 +1,25 @@
|
||||
# @summary Adds a sysctl file, and immediately runs it.
|
||||
define zulip::sysctl (
|
||||
$source = undef,
|
||||
$content = undef,
|
||||
$skip_docker = False,
|
||||
) {
|
||||
file { "/etc/sysctl.d/40-${name}.conf":
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
source => $source,
|
||||
content => $content,
|
||||
}
|
||||
$onlyif = $skip_docker ? {
|
||||
true => 'touch /proc/sys/net/core/somaxconn',
|
||||
default => undef,
|
||||
}
|
||||
exec { "sysctl_p_${name}":
|
||||
command => "/sbin/sysctl -p /etc/sysctl.d/40-${name}.conf",
|
||||
subscribe => File["/etc/sysctl.d/40-${name}.conf"],
|
||||
refreshonly => true,
|
||||
onlyif => $onlyif,
|
||||
}
|
||||
}
|
||||
@@ -9,18 +9,9 @@ class zulip_ops::profile::postgresql {
|
||||
|
||||
zulip_ops::firewall_allow{ 'postgresql': }
|
||||
|
||||
file { '/etc/sysctl.d/40-postgresql.conf':
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
zulip::sysctl { 'postgresql':
|
||||
source => 'puppet:///modules/zulip_ops/postgresql/40-postgresql.conf',
|
||||
}
|
||||
exec { 'sysctl_p':
|
||||
command => '/sbin/sysctl -p /etc/sysctl.d/40-postgresql.conf',
|
||||
subscribe => File['/etc/sysctl.d/40-postgresql.conf'],
|
||||
refreshonly => true,
|
||||
}
|
||||
|
||||
file { '/root/setup_disks.sh':
|
||||
ensure => file,
|
||||
|
||||
Reference in New Issue
Block a user