define virtual::vserver::rlimit( $vserver, $limit, $soft = '', $hard = '', $min = '', $ensure = present ) { file { "/etc/vservers/${vserver}/rlimits/$limit.soft": mode => 0644, owner => root, group => root, content => "$soft\n", ensure => $soft ? { '' => absent, default => $ensure, }, require => File["/etc/vservers/${vserver}/rlimits"], notify => Exec["vs_restart_${vserver}"], } file { "/etc/vservers/${vserver}/rlimits/$limit.hard": mode => 0644, owner => root, group => root, content => "$hard\n", ensure => $hard ? { '' => absent, default => $ensure, }, require => File["/etc/vservers/${vserver}/rlimits"], notify => Exec["vs_restart_${vserver}"], } file { "/etc/vservers/${vserver}/rlimits/$limit.min": mode => 0644, owner => root, group => root, content => "$min\n", ensure => $min? { '' => absent, default => $ensure, }, require => File["/etc/vservers/${vserver}/rlimits"], notify => Exec["vs_restart_${vserver}"], } }