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

Version Path
bolt-3.29.0 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.28.0 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.27.4 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.27.2 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.27.1 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.26.2 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.26.1 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.25.0 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.24.0 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.23.1 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.23.0 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.22.1 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.22.0 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.21.0 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.20.0 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.19.0 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.18.0 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.17.0 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.16.1 lib/bolt_server/plugin/puppet_connect_data.rb
bolt-3.16.0 lib/bolt_server/plugin/puppet_connect_data.rb