Argh. I have the definition below. The gluster peer probe command has
already been executed successfully, and I'm testing it with 'peer
status'. Running the unless=> command yields:
root@gfs01:~# /usr/sbin/gluster peer status | /bin/grep
gfs02.us1.xxx.com
Hostname:
gfs02.us1.xxx.com
root@gfs01:~# echo $?
0
Therefore, the command should never run again, but it is, as evidenced
by the fact that /tmp/foo keeps getting X appended to it.
define glusterfs::probe_peer ( $ensure, $master_node ) {
if $master_node == $::fqdn {
case $ensure {
'probed': {
exec {
"add-peer-$name":
#command => "/usr/sbin/gluster peer probe $name",
command => "/bin/echo X >> /tmp/foo",
logoutput => true,
unless => "/usr/sbin/gluster peer status |
/bin/grep $name";
}
}
}
}
}
Doug.