-
Notifications
You must be signed in to change notification settings - Fork 25
Description
When I declare two constraints on the same resrource only one gets created.
For example:
pacemaker::constraint::base{'mysql-avoid':
constraint_type => 'location',
first_resource => $mysql_resource_group_name,
location => $cluster_quorum_host,
score => '-INFINITY'
}
pacemaker::constraint::base{'mysql-prefer':
constraint_type => 'location',
first_resource => $mysql_resource_group_name,
location => $mysql_preferred_host,
score => 'INFINITY'
}
The idea here is to make mysql prefer one host, and avoid another. However, only one constraint gets created.
The reason is that in the base.pp the "unless" clause tests on the presence of the resource name in the ouutput of "pcs location show". As a result the second resource is not created on the host.
My solution was the following modification:
replace:
unless => "/usr/sbin/pcs constraint location show | grep ${first_resource} > /dev/null 2>&1",
with:
unless => "/usr/sbin/pcs constraint location show --full | grep ${name}",
I can send a patch if you want (but I'm a complete git newbie...)