summaryrefslogtreecommitdiff
path: root/sysutils/puppet/patches/patch-ab
blob: 84ecc0d471823e67a813fbcf2b55b0299f777b06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$NetBSD: patch-ab,v 1.5 2013/04/10 21:10:55 tonnerre Exp $

Make the FreeBSD provider the default for NetBSD as well.
Omit _enabled for init scripts under NetBSD, which doesn't look for them.

--- lib/puppet/provider/service/freebsd.rb.orig	2013-04-01 00:44:50.000000000 +0000
+++ lib/puppet/provider/service/freebsd.rb
@@ -3,7 +3,7 @@ Puppet::Type.type(:service).provide :fre
   desc "Provider for FreeBSD and DragonFly BSD. Uses the `rcvar` argument of init scripts and parses/edits rc files."
 
   confine :operatingsystem => [:freebsd, :dragonfly]
-  defaultfor :operatingsystem => [:freebsd, :dragonfly]
+  defaultfor :operatingsystem => [:freebsd, :netbsd, :dragonfly]
 
   def rcconf()        '/etc/rc.conf' end
   def rcconf_local()  '/etc/rc.conf.local' end
@@ -86,6 +86,9 @@ Puppet::Type.type(:service).provide :fre
   # Add a new setting to the rc files
   def rc_add(service, rcvar, yesno)
     append = "\# Added by Puppet\n#{rcvar}_enable=\"#{yesno}\"\n"
+    if Facter.value(:operatingsystem) == "NetBSD"
+      append = "\# Added by Puppet\n#{rcvar}=\"#{yesno}\"\n"
+    end
     # First, try the one-file-per-service style
     if File.exists?(rcconf_dir)
       File.open(rcconf_dir + "/#{service}", File::WRONLY | File::APPEND | File::CREAT, 0644) {