Heartbeat V2 recipe
class heartbeat {
package { "heartbeat-2":
ensure => installed
}
service {
heartbeat:
# name of the init script?
name => heartbeat,
ensure => running,
hasstatus => true;
}
# this is a pseudo-service just to update the CIB database
exec {
heartbeat-update-cib:
command => "/usr/sbin/cibadmin -R -x /etc/ha.d/cib.xml",
refreshonly => True,
}
remotefile {
"/etc/ha.d/ha.cf":
mode => 444, source => "apps/heartbeat/ha.cf",
require => Package["heartbeat-2"],
notify => Service["heartbeat"];
"/etc/ha.d/authkeys":
mode => 400, source => "apps/heartbeat/authkeys",
require => Package["heartbeat-2"],
notify => Service["heartbeat"];
# don't restart heartbeat when updating the CIB, but do it on-the-fly
"/etc/ha.d/cib.xml":
mode => 444, source => "apps/heartbeat/cib.xml",
require => Package["heartbeat-2"],
notify => Exec["heartbeat-update-cib"];
}
}