Friday, September 21, 2012

Release only specific sanlock resource

On august 29 2012, libvirt 0.10.0 has been released which includes the sanlock bugfix when hot-dettaching virtual disks:

http://libvirt.org/news.html

Wednesday, September 19, 2012

Test puppet code from shell

Sometimes it comes in handy to quickly test some puppet code or conditions from the command line.  The following command greps for ID in a file, and unless found it echoes a string (or does something more useful):

# ralsh exec "/bin/echo ID not found" unless="/bin/grep -q ID /etc/default/mpt-statusd"

If the "unless" command returns "1", the "exec" command is executed.
The inverted situation is covered by "onlyif".  If the "onlyif" command returns "0", the "exec" command will be executed.