Hi,
I have created a define with packages services and a mount inside, but when
I notify the define all of them receive the notify but I want only refresh
the mount.
It is possible?
Here is my define:
define xmount (
$device = undef,
$device_base = undef,
$device_qa = undef,
$device_dev = undef,
$options = "defaults",
$options_base = undef,
$options_qa = undef,
$options_dev = undef,
$path = undef,
$atboot = true,
$ensure = mounted,
$fstype = undef,
$remounts = true,
$remounts_lazy = false,
$dump = 0,
$pass = 0) {
if ($fstype = "nfs") {
if !defined(Package["portmap"]) {
package { "portmap": ensure => present; }
}
if !defined(Package["initscripts"]) {
package { "initscripts": ensure => present; }
}
if !defined(Service["portmap"]) {
service { "portmap":
enable => true,
ensure => running,
hasrestart => true,
hasstatus => true,
subscribe => Package["portmap", "initscripts"],
notify => Mount["${path}"];
}
}
if !defined(Service["netfs"]) {
service { "netfs":
enable => true,
ensure => running,
hasrestart => true,
hasstatus => true,
subscribe => Package["portmap", "initscripts"],
notify => Mount["${path}"];
}
}
}
case $pool {
default : {
$deviceA = $device
$optionsA = $options
}
/.*-q-prt$/, /.*-q-pla$/, /.*-qa$/ : {
$deviceA = $device_qa
$optionsA = $options_qa
}
/.*-s-prt$/, /.*-s-pla$/, /.*-stg$/, /.*-dev$/ : {
$deviceA = $device_dev
$optionsA = $options_dev
}
/.*-base$/ : {
$deviceA = $device_base
$optionsA = $options_base
}
}
$device_chosed = "${deviceA}" ? {
default => "${deviceA}",
undef => "${device}"
}
$options_chosed = "${optionsA}" ? {
default => "${optionsA}",
undef => "${options}"
}
if ($device_chosed != "") {
exec { "define_xmount_recursedir-${title}-${path}":
command => "mkdir -p '${path}'",
unless => "test -d '${path}'",
cwd => "/tmp",
logoutput => on_failure,
path => [
"/bin",
"/sbin",
"/usr/bin",
"/usr/sbin"],
timeout => 2;
}
mount { "${path}":
atboot => $atboot,
device => $mount_chosed,
ensure => $ensure,
fstype => $fstype,
options => $options_chosed,
remounts => $remounts,
dump => $dump,
pass => $pass,
require => Exec["define_xmount_recursedir-${title}-${path}"];
}
}
}
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/86W7_S9LIUAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.