Files
puppet-pacemaker/lib/pacemaker/options.rb
Dmitry Ilyin 4d2e554f68 Merge with fuel-infra/puppet-pacemaker
* Import all providers, specs and tests to this module
* Use corosync module to actually install paceamker

Fuel-CI: disable
Change-Id: I9a16ad1453b694aa0a3e78d079f9c57365a5fcf1
2016-05-25 11:22:22 +02:00

32 lines
901 B
Ruby

module Pacemaker
# pacemaker options submodule
# takes the options structure from the YAML file
# other options sources can be implemented here
module Options
# the YAML file with pacemaker options
# @return [String]
def self.pacemaker_options_file
File.join File.dirname(__FILE__), 'options.yaml'
end
# pacemaker options structure (class level)
# @return [Hash]
def self.pacemaker_options
return @pacemaker_options if @pacemaker_options
@pacemaker_options = YAML.load_file pacemaker_options_file
end
# pacemaker options structure (instance level)
# @return [Hash]
def pacemaker_options
Pacemaker::Options.pacemaker_options
end
# maximum possible waiting time of retry functions
# @return [Integer]
def max_wait_time
pacemaker_options[:retry_count] * pacemaker_options[:retry_step]
end
end
end