Provider pcs for cs_location type does not set resource_discovery when using rules
Opened this issue · 1 comments
Affected Puppet, Ruby, OS and module versions/distributions
- Puppet: 5.5.2
- Ruby: ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux]
- Distribution: Ubuntu 18.04
- Module version: 6.0.1
How to reproduce (e.g Puppet code you use)
Create a cs_location
which does not set node_name
but does set rules
.
cs_location { "location_${primitive_name}":
primitive => "${primitive_name}",
resource_discovery => 'never',
rules => [
# Avoid hosts which do not have the required attribute
{
"${primitive_name}_require-foo" => {
'score' => '-INFINITY',
'boolean-op' => 'or',
'expression' => [
{
'attribute' => 'foo',
'operation' => 'not_defined',
},
{
'attribute' => 'foo',
'operation' => 'ne',
'value' => 'true', # lint:ignore:quoted_booleans
},
],
},
},
],
cib => 'test',
}
What are you seeing
The constraint is created without the resource-discovery
attribute being set.
What behaviour did you expect instead
The resource-discovery
attribute to be set.
Any additional information you'd like to impart
Looking at the source, resource discovery is only set when a node is specified:
Adding params << "resource-discovery=#{@property_hash[:resource_discovery]}" if count.zero? unless @property_hash[:resource_discovery].nil?
to the following block should fix the issue but I haven't tested this yet:
puppet-corosync/lib/puppet/provider/cs_location/pcs.rb
Lines 108 to 112 in d77784a
Currently I am unable to use the crm provider because of #447 and the pcs provider because of this issue.
Hi @qcfabrizio - You are right. Can you submit a PR with your proposal?