From 87b2350bae6e1692b9eed96f3108850f35d7b912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Tue, 15 Mar 2011 00:31:40 +0200 Subject: [PATCH] Fixed inetd module for OpenBSD. --- inetd/manifests/init.pp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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}") }