Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/74852
Change subject: Replace uses of generic::sysctl with sysctlfile module ...................................................................... Replace uses of generic::sysctl with sysctlfile module Also, remove generic::sysctl. Change-Id: I80594fd7932987d4c2380d14e89e341c48a30dad --- M manifests/generic-definitions.pp M manifests/role/ceph.pp M modules/toollabs/manifests/exec_environ.pp 3 files changed, 4 insertions(+), 82 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/52/74852/1 diff --git a/manifests/generic-definitions.pp b/manifests/generic-definitions.pp index 6e063b1..09ed452 100644 --- a/manifests/generic-definitions.pp +++ b/manifests/generic-definitions.pp @@ -708,84 +708,6 @@ } } -# Sysctl settings - -# Define: sysctl -# -# Creates a file in /etc/sysctl.d to set sysctl settings, and reloads -# sysctl with the new settings. -# -# There are three ways to use this define. You must specify one of -# $value, $content, or $source. Not specifying one of these results -# in a parse failure. -# -# Usage 1: $value -# sysctl { "net.core.rmem_max": value => 16777218 } -# -# Usage 2: $content -# $rmem_max = 536870912 -# sysctl { "custom_rmem_max": content => template("sysctl/sysctl_rmemmax.erb") } -# -# Usage 3: $source -# sysctl { "custom_rmem_max": source => "puppet:///files/misc/rmem_max.sysctl.conf" } -# -# Parameters: -# $value - Puts "$title = $value" in the sysctl.d file. -# $content - Puts this exact content in the sysctl.d file. -# $source - Puts the $source file at the sysctl.d file. -# $ensure - Either 'present' or 'absent'. Default: 'present'. -# $number_prefix - The load order prefix number in the sysctl.d filename. Default '60'. You probably don't need to change this. -# -define sysctl( - $value = undef, - $content = undef, - $source = undef, - $ensure = "present", - $number_prefix = "60") -{ - $sysctl_file = "/etc/sysctl.d/${number_prefix}-${title}.conf" - - file { "$sysctl_file": - mode => 0444, - owner => "root", - group => "root", - ensure => $ensure, - } - - # if using $value, then set $title = $value in the sysctl.d file - if $value { - File[$sysctl_file] { content => "${title} = ${value}" } - } - # else just set the content - elsif $content { - File[$sysctl_file] { content => $content } - } - # else put the file in place from a source file. - elsif $source { - File[$sysctl_file] { source => $source } - } - # if none of the above are defined, then throw a parse failure. - else { - alert("sysctl '${title}' must specify one of \$content, \$source or \$value.") - } - - # Refresh sysctl if we are ensuring the sysctl.d file - # exists. NOTE: I'm not sure how to reset the sysctl - # value to its original if we ensure => absent. For now, - # that will have to wait until a reboot happens. This - # probably won't be a real problem anyway. Anyone - # using this define can just explicitly set the value - # back to what it should be, rather than using ensure => 'absent'. - if $ensure == 'present' { - # refresh sysctl when the sysctl file changes - exec { "sysctl_reload_${title}": - command => "/sbin/sysctl -p $sysctl_file", - subscribe => File["$sysctl_file"], - refreshonly => true, - } - } -} - class generic::sysfs::enable-rps { upstart_job { "enable-rps": install => "true", start => "true" } } diff --git a/manifests/role/ceph.pp b/manifests/role/ceph.pp index bf79d54..891a541 100644 --- a/manifests/role/ceph.pp +++ b/manifests/role/ceph.pp @@ -67,10 +67,10 @@ include ceph::osd # I/O busy systems, tune a few knobs to avoid page alloc failures - sysctl { 'sys.vm.min_free_kbytes': + sysctlfile { 'sys.vm.min_free_kbytes': value => '512000', } - sysctl { 'sys.vm.vfs_cache_pressure': + sysctlfile { 'sys.vm.vfs_cache_pressure': value => '120', } } diff --git a/modules/toollabs/manifests/exec_environ.pp b/modules/toollabs/manifests/exec_environ.pp index b851184..86a0058 100644 --- a/modules/toollabs/manifests/exec_environ.pp +++ b/modules/toollabs/manifests/exec_environ.pp @@ -150,8 +150,8 @@ ensure => present } - sysctl { "vm.overcommit_memory": value => 2 } - sysctl { "vm.overcommit_ratio": value => 95 } + sysctlfile { "vm.overcommit_memory": value => 2 } + sysctlfile { "vm.overcommit_ratio": value => 95 } # TODO: quotas } -- To view, visit https://gerrit.wikimedia.org/r/74852 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I80594fd7932987d4c2380d14e89e341c48a30dad Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew Bogott <abog...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits