Sha256: ca43387589cb4789117acf7c71c2f219c05f7dea3b5fbc886da793349d0acceb

Contents?: true

Size: 1.45 KB

Versions: 7

Compression:

Stored size: 1.45 KB

Contents

# frozen_string_literal: true

Puppet::DataTypes.create_type('Target') do
  begin
    inventory = Puppet.lookup(:bolt_inventory)
    target_implementation_class = inventory.target_implementation_class
  rescue Puppet::Context::UndefinedBindingError
    target_implementation_class = Bolt::Target
  end

  require 'bolt/target'

  interface <<-PUPPET
    attributes => {
      uri => { type => Optional[String[1]], kind => given_or_derived },
      name => { type => Optional[String[1]] , kind => given_or_derived },
      safe_name => { type =>  Optional[String[1]], kind => given_or_derived },
      target_alias => { type => Optional[Variant[String[1], Array[String[1]]]], kind => given_or_derived },
      config => { type => Optional[Hash[String[1], Data]], kind => given_or_derived },
      vars => { type => Optional[Hash[String[1], Data]], kind => given_or_derived },
      facts => { type => Optional[Hash[String[1], Data]], kind => given_or_derived },
      features => { type => Optional[Array[String[1]]], kind => given_or_derived },
      plugin_hooks => { type => Optional[Hash[String[1], Data]], kind => given_or_derived }
    },
    functions => {
      host => Callable[[], Optional[String]],
      password => Callable[[], Optional[String[1]]],
      port => Callable[[], Optional[Integer]],
      protocol => Callable[[], Optional[String[1]]],
      user => Callable[[], Optional[String[1]]],
    }
  PUPPET

  implementation_class target_implementation_class
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bolt-2.4.0 bolt-modules/boltlib/lib/puppet/datatypes/target.rb
bolt-2.3.1 bolt-modules/boltlib/lib/puppet/datatypes/target.rb
bolt-2.3.0 bolt-modules/boltlib/lib/puppet/datatypes/target.rb
bolt-2.2.0 bolt-modules/boltlib/lib/puppet/datatypes/target.rb
bolt-2.1.0 bolt-modules/boltlib/lib/puppet/datatypes/target.rb
bolt-2.0.1 bolt-modules/boltlib/lib/puppet/datatypes/target.rb
bolt-2.0.0 bolt-modules/boltlib/lib/puppet/datatypes/target.rb