File: server_array_to_hash.pp

package info (click to toggle)
puppet-module-aboe-chrony 3.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 356 kB
  • sloc: ruby: 594; sh: 10; makefile: 8
file content (13 lines) | stat: -rw-r--r-- 438 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
# @summary Function to normalise servers/pools/peers
#
# @api private
# @return [Hash] returns the original hash or converts the array to an hash
function chrony::server_array_to_hash(Variant[Hash,Array] $servers, $options = []) >> Hash {
  if $servers.is_a(Hash) {
    $servers
  } else {
    $servers.reduce({}) |$memo, $server| { # lint:ignore:manifest_whitespace_opening_brace_before
      $memo + { $server => $options }
    }
  }
}