Skip to content

Find a way to pass information from the manifest to the get method. #242

Open
@DavidS

Description

@DavidS

Example for how this is currently used/implemented:

https://github.com/puppetlabs/puppetlabs-sqlserver/blob/b36eecf3fdadb3d45c9691fcac2e92c66fa3ad30/lib/puppet/provider/sqlserver_tsql/mssql.rb#L16-L26

  def get_config(instance = resource[:instance])
    config_resc = resource.catalog.resources.find do |resc|
      resc.title =~ %r{Sqlserver::Config} &&
        resc.original_parameters[:instance_name] =~ %r{#{instance}}i
    end
    if config_resc.nil?
      raise("Sqlserver_tsql[#{resource.title}] was unable to retrieve the config, please ensure the catalog contains sqlserver::config{'#{resource[:instance]}':}")
    end


    config_resc.original_parameters
  end

Puppet::Type's resource.catalog.resources provides access to other resources in the current catalog.

Possible implementation:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions