Sha256: 7d725b76d1fab6f3a26743173c360d164c6727b56cf3129c8e607232551c2fe9
Contents?: true
Size: 827 Bytes
Versions: 47
Compression:
Stored size: 827 Bytes
Contents
# frozen_string_literal: true module BoltServer class Plugin class PuppetConnectData def initialize(data, **_opts) @data = data end def name 'puppet_connect_data' end def hooks %i[resolve_reference validate_resolve_reference] end def resolve_reference(opts) key = opts['key'] @data.dig(key, 'value') end def validate_resolve_reference(opts) unless opts['key'] raise Bolt::ValidationError, "puppet_connect_data plugin requires that 'key' be specified" end unless @data.key?(opts['key']) raise Bolt::ValidationError, "puppet_connect_data plugin tried to lookup key '#{opts['key']}' but no value was found" end end end end end
Version data entries
47 entries across 47 versions & 1 rubygems