Skip to content

Puppet Fails to Resolve Hostname Using ${hostname}\ and any other Variable in Source Path #9500

@banafshehft

Description

@banafshehft

Describe the Bug

I am encountering an issue with Puppet where the ${hostname} variable is not resolving correctly in the source path of a file resource. The following manifest snippet is intended to retrieve a certificate file based on the system hostname:

file { '/etc/ssl/certs/Certname':
  source => "puppet:///modules/arch/vault-certs/${hostname}.Certname",
  mode   => '0644',
}

However, this results in a 404 Not Found error, as Puppet is not expanding the ${hostname} variable correctly, leading to it searching for an incorrect file name.

Expected Behavior

expected Puppet to resolve the ${hostname} variable correctly and construct the appropriate source path to retrieve the certificate file.

I have to mention it is a bug in the puppet version : puppet 8.9.0-4

Environment

  • puppet 8.9.0-4
  • Platform : linux 6.11.3.arch1-1

Additional Context

Could you please provide a temporary solution to the issue at hand, at least until we can implement a permanent fix? Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions