Puppet Function: ssh::config_bool_translate
- Defined in:
- lib/puppet/functions/ssh/config_bool_translate.rb
- Function type:
- Ruby 4.x API
Summary
Translates true|false or 'true'|'false' to 'yes'|'no', respectivelyOverview
All other values are passed-through unchanged
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/puppet/functions/ssh/config_bool_translate.rb', line 4 Puppet::Functions.create_function(:'ssh::config_bool_translate') do # @param config_item Configuration item to be translated # @return transformed config_item dispatch :config_bool_translate do required_param 'String', :config_item end # @param config_item Configuration item to be translated # @return transformed config_item dispatch :config_bool_translate do required_param 'Boolean', :config_item end def config_bool_translate(config_item) bool_translation = { true => 'yes', 'true' => 'yes', false => 'no', 'false' => 'no' } return config_item if not bool_translation.keys.include?(config_item) bool_translation[config_item] end end |