Skip to content

Use of deferred function fails due to complex types in epp #513

Closed
puppetlabs/puppetlabs-stdlib
#1425
@traylenator

Description

@traylenator

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.24.0
  • Module version:

How to reproduce (e.g Puppet code you use)

Needs to be run on a puppet server and distinct agent setup, i.e not rspec or puppet apply.

redis::instance{String($port):
  service_enable => true,
  service_ensure => 'running',
  requirepass    => Deferred('secret::get',['redis_password']),
  port           => $port,                                      
  bind           => [], # all interfaces
}

What are you seeing

It compiles fine but during the stdlib::deferable_epp part in the apply

Error: Failed to apply catalog: Evaluation Error: Resource type not found: Stdlib::Absolutepath (file: inlined-epp-text, line: 3, column: 3)

What behaviour did you expect instead

Should be possible to set password as a deferred to be late evaluated on the agent however it fails due to lack of rich
data types being available on the agent nodes.

Any additional information you'd like to impart

The only way I know to "fix" this is to strip back the data types in the template to core data types e..g

Stdlib::Absolutepath -> String[1]

would be very happy to hear if other options are available.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions