Skip to content

Commit

Permalink
Fixing setting of resource_discovery parameter.
Browse files Browse the repository at this point in the history
The crm provider for cs_location did never set that. A version check
ensures that parameter is only set when running pacemakerd >= 1.1.13

Fixes voxpupuli#449
  • Loading branch information
timdeluxe committed Sep 20, 2018
1 parent 052bcc4 commit 36b17c0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/puppet/provider/cs_location/crm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,21 @@
# Path to the crm binary for interacting with the cluster configuration.
# Decided to just go with relative.
commands crm: 'crm'

# Path to the pacemakerd binary to check version for resource_discovery feature
# Decided to just go with relative.
commands pacemakerd: 'pacemakerd'

mk_resource_methods

# we need to check if we run at least pacemakerd version 1.1.13 before enabling feature discovery
# see http://blog.clusterlabs.org/blog/2014/feature-spotlight-controllable-resource-discovery
pacemakerd_version_string = pacemakerd('--version')
pacemakerd_version = pacemakerd_version_string.scan(%r{\d+\.\d+\.\d+}).first unless pacemakerd_version_string.nil?
if Puppet::Util::Package.versioncmp(pacemakerd_version,'1.1.13') >= 0
has_feature :discovery
end

def self.instances
block_until_ready

Expand Down

0 comments on commit 36b17c0

Please sign in to comment.