From a564290bbe9b9bc78bd9d017e2a047f89bd3bb34 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 2 Jun 2013 21:43:51 -0300 Subject: Adding sysctl definition --- manifests/defines/sysctl.pp | 19 +++++++++++++++++++ manifests/init.pp | 1 + manifests/role/nas.pp | 5 +++++ 3 files changed, 25 insertions(+) create mode 100644 manifests/defines/sysctl.pp (limited to 'manifests') diff --git a/manifests/defines/sysctl.pp b/manifests/defines/sysctl.pp new file mode 100644 index 0000000..06f6a14 --- /dev/null +++ b/manifests/defines/sysctl.pp @@ -0,0 +1,19 @@ +# Simple sysctl definition +define sysctl( + $ensure = present, + $value +) { + file { "/etc/sysctl.d/${name}.conf": + owner => "root", + group => "root", + mode => 0644, + ensure => $ensure, + content => "$name = $value\n", + } + + exec { "sysctl ${name}=${value}": + user => root, + subscribe => File["/etc/sysctl.d/${name}.conf"], + refreshonly => true, + } +} diff --git a/manifests/init.pp b/manifests/init.pp index dce9859..9f6bc2a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -99,3 +99,4 @@ import "defines/munin_node.pp" import "defines/ssh_config.pp" import "defines/ssh_create_key.pp" import "defines/ssh_known_hosts.pp" +import "defines/sysctl.pp" diff --git a/manifests/role/nas.pp b/manifests/role/nas.pp index 3ab7bb5..f834322 100644 --- a/manifests/role/nas.pp +++ b/manifests/role/nas.pp @@ -39,6 +39,11 @@ class nodo::role::nas( $dlna = hiera('nodo::role::nas::dlna', false) if $dlna == true { + # See https://wiki.archlinux.org/index.php/MiniDLNA#Automatic_Media_DB_Update + sysctl { 'fs.inotify.max_user_watches': + value => 100000, + } + class { 'minidlna': } } -- cgit v1.2.3