puppetlabs / puppetlabs-apt

Puppet module to help manage Apt
https://forge.puppetlabs.com/puppetlabs/apt
Apache License 2.0
215 stars 462 forks source link

Error: Unknown variable: 'apt::key_options' #1184

Closed sahaqaa closed 4 months ago

sahaqaa commented 4 months ago

Describe the Bug

Previously we had Puppet 5.3, now we've installed new OS and new Puppet 8. We also using the latest version of module (9.4.0). When we run "puppet agent -t --noop" we are getting next error:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Unknown variable: 'apt::key_options'. (file: /etc/puppetlabs/code/environments/update_modules_versions/modules/apt/manifests/key.pp, line: 45, column: 123)

When looking into code of module itself i can see only 1 mention of it: https://github.com/puppetlabs/puppetlabs-apt/blob/776d7b4e487498293a406ec6bb953be68bb3cace/manifests/key.pp#L45 Seems that it is optional, but for some reason it is still causing error

Optional[String] $options             = $apt::key_options,

Expected Behavior

This error "Unknown variable: 'apt::key_options'" should not appear when running puppet agent.

Environment

Additional Context

Error above actually references two files, one from puppetlabs-apt (that i referenced above) and second file is where we call it in our code:

    apt::key { 'wazuh_agent':
      id     => '0DCFCA5547B19D2A6099506096B3EE5F29111145',
      source => 'https://packages.wazuh.com/key/GPG-KEY-WAZUH',
      server => 'pgp.mit.edu',
      before => Apt::Source[$wazuh_agent::repo_name],
    }
sahaqaa commented 4 months ago

Woops, sorry, added "include apt" and it worked.