diff --git a/inetd/manifests/init.pp b/inetd/manifests/init.pp index c26b264..83a3ede 100644 --- a/inetd/manifests/init.pp +++ b/inetd/manifests/init.pp @@ -49,8 +49,9 @@ class inetd::server::xinetd { class inetd::server::inetd { service { "inetd": - ensure => running, - enable => true, + ensure => running, + start => "inetd", + enable => true, } } @@ -83,6 +84,20 @@ define inetd::service($ensure = present) { notify => Service["xinetd"], } } + openbsd: { + exec { "enable-inetd-${name}": + command => $ensure ? { + "present" => "ruby -pi -e 'sub(/^#${name}(\\s+)/, \"${name}\\\1\")' /etc/inetd.conf", + "absent" => "ruby -pi -e 'sub(/^${name}(\\s+)/, \"#${name}\\\1\")' /etc/inetd.conf", + }, + unless => $ensure ? { + "present" => "egrep '^tftp[[:space:]]' /etc/inetd.conf", + "absent" => "egrep '^#tftp[[:space:]]' /etc/inetd.conf", + }, + path => "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin", + notify => Service["inetd"], + } + } default: { fail("Inetd module not supported in ${operatingsystem}") }