genanr@allantgroup.com
2009-May-01 18:10 UTC
[Puppet Users] Using arrays with the name attribute of service
I saw this mention in feature request #321, but here is what I have:
service { "nfs" :
name => $operatingsystem ? {
Debian => [ "nfs-common",
"nfs-kernel-
server" ],
Ubuntu => [ "nfs-common",
"nfs-kernel-
server" ],
OpenSuSE => [ "nfs-client",
"nfs-
kernel-server" ],
default => [ "nfs-utils" ],
},
ensure=>running,
enable=>true,
hasstatus=>true,
restart=>true,
require=> $operatingsystem ? {
Debian => Package[
"nfs-common","nfs-
kernel-server"],
Ubuntu => Package[
"nfs-common","nfs-
kernel-server"],
OpenSuSE => Package["nfs-client",
"nfs-
kernel-server"],
default => Package
[ "nfsserver","nfslock"],
},
}
I would like to have ONE common service name for each distribution
here, so I can notify it to restart when the exports file gets
changed. The solution mention for bug #321 does not look like it
would do that, it would name a service with the OS name, which would
work, but what if I need that elsewhere? When I try running it, it
seems to partially work :
Run on a debian system I get :
debug: Service[nfs](provider=debian): Could not find nfs-commonnfs-
kernel-server in /etc/init.d
debug: Service[nfs](provider=debian): Could not find nfs-commonnfs-
kernel-server.sh in /etc/init.d
err: //Node[linuxdev1.emsphone.com]/baseclass/nfs/Service[nfs]: Failed
to retrieve current state of resource: Could not find init script for
''nfs-common''
The name of the script it is looking for is different than the name it
says it is looking for.
Is there another, clean way of doing this.
Thanks,
Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---
