Sha256: c03c4df609d9f82ef3e105b3129e55ad643c6fb26938ed7058bc9263269d2856

Contents?: true

Size: 436 Bytes

Versions: 3

Compression:

Stored size: 436 Bytes

Contents

# frozen_string_literal: true

module Bolt
  class Plugin
    class Puppetdb
      def initialize(pdb_client)
        @puppetdb_client = pdb_client
      end

      def name
        'puppetdb'
      end

      def hooks
        ['lookup_targets']
      end

      def lookup_targets(opts)
        nodes = @puppetdb_client.query_certnames(opts['query'])
        nodes.map { |certname| { 'uri' => certname } }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bolt-1.20.0 lib/bolt/plugin/puppetdb.rb
bolt-1.19.0 lib/bolt/plugin/puppetdb.rb
bolt-1.18.0 lib/bolt/plugin/puppetdb.rb