Puppet Function: pacemaker_cluster_options
- Defined in:
- lib/puppet/parser/functions/pacemaker_cluster_options.rb
- Function type:
- Ruby 3.x API
Overview
Convert the cluster options to the “pcs cluster create” CLI options string
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/puppet/parser/functions/pacemaker_cluster_options.rb', line 2 newfunction( :pacemaker_cluster_options, type: :rvalue, arity: 1, doc: <<-eof Convert the cluster options to the "pcs cluster create" CLI options string eof ) do |args| = args[0] break '' unless break if .is_a? String if .is_a? Hash = [] .each do |option, value| option = "--#{option}" unless option.start_with? '--' if value.is_a? TrueClass or value.is_a? FalseClass << option if value else << option << value end end = end [].flatten.join ' ' end |