fuel-library/deployment/puppet/cluster/manifests/sysinfo.pp
Alex Schultz dd5ac7145f Fix sysinfo resource declaration
This change replaces the use of clone resources as each node may have a
different disk layout. Additionally this change replaces cs_location
with cs_rsc_location which has a proper autorequire for the cs_resource
being defined.

Change-Id: Ifa8a6932c0f0ba2bc05bc0ea9278cbfbe5ae8bb9
Closes-Bug: #1501410
Closes-Bug: #1504085
2015-10-09 08:40:18 -05:00

64 lines
1.7 KiB
Puppet

# == Class: cluster::sysinfo
#
# Configure pacemaker sysinfo disk monitor
#
# === Parameters
#
# [*disks*]
# (optional) array of mount points to monitor for free space. / is monitored
# by default it does not need to be specified.
# Defaults to []
#
# [*min_disk_free*]
# (optional) Minimum amount of free space required for the paritions
# Defaults to '100M'
#
# [*disk_unit*]
# (optional) Unit for disk space
# Defaults to 'M'
#
# [*monitor_interval*]
# (optional) Internval to monitor free space
# Defaults to '60s'
#
# [*monitor_ensure*]
# (optional) Ensure the corosync monitor is installed
# Defaults to present
#
class cluster::sysinfo (
$disks = [],
$min_disk_free = '100M',
$disk_unit = 'M',
$monitor_interval = '15s',
$monitor_ensure = present,
) {
# NOTE: We do not use a clone resource here as disks may be different per host
cs_resource { "sysinfo_${::fqdn}":
ensure => $monitor_ensure,
primitive_class => 'ocf',
provided_by => 'pacemaker',
primitive_type => 'SysInfo',
parameters => {
'disks' => join(any2array($disks), ' '),
'min_disk_free' => $min_disk_free,
'disk_unit' => $disk_unit,
},
operations => { 'monitor' => { 'interval' => $monitor_interval } },
}
# Have service migrate if health turns red from the failed disk check
cs_property { 'node-health-strategy':
ensure => present,
value => 'migrate-on-red',
provider => 'crm',
}
cs_rsc_location { "sysinfo-on-${::fqdn}":
primitive => "sysinfo_${::fqdn}",
node_name => $::fqdn,
node_score => 'INFINITY',
cib => "sysinfo_${::fqdn}",
}
}