puppetlabs / puppetlabs-apt

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

proxy no longer working when using apt::key with "source" param. #1037

Open jsfrerot opened 2 years ago

jsfrerot commented 2 years ago

Describe the Bug

With olderversion of apt module this used to work:

    apt::source { 'elastic-7':
      comment  => "Elastic packages 7",
      location => "http://artifacts.elastic.co/packages/7.x/apt",
      release  => 'stable',
      repos    => 'main',
      key      => {
        'id'     => '46095ACC8548582C1A2699A9D27D666CD88E42B4',
        'source' => 'https://artifacts.elastic.co/GPG-KEY-elasticsearch',
        'proxy'  => "http://${::location}-aptcacher-001.mydomain.com:3142/",
      },
      include  => {
        'deb' => true,
      },
    }

Now this timeout:

Error: Could not set 'present' on ensure: execution expired (file: /opt/data/puppet_git/modules/apt/manifests/key.pp, line: 54)
Error: Could not set 'present' on ensure: execution expired (file: /opt/data/puppet_git/modules/apt/manifests/key.pp, line: 54)
Wrapped exception:
execution expired
Error: /Stage[main]/repos::Elastic7/Apt::Source[elastic-7]/Apt::Key[Add key: 46095ACC8548582C1A2699A9D27D666CD88E42B4 from Apt::Source elastic-7]/Apt_key[Add key: 46095ACC8548582C1A2699A9D27D666CD88E42B4 from Apt::Source elastic-7]/ensure: change from 'absent' to 'present' failed: Could not set 'present' on ensure: execution expired (file: /opt/data/puppet_git/modules/apt/manifests/key.pp, line: 54)
Notice: /Stage[main]/repos::Elastic7/Apt::Source[elastic-7]/Apt::Key[Add key: 46095ACC8548582C1A2699A9D27D666CD88E42B4 from Apt::Source elastic-7]/Anchor[apt_key 46095ACC8548582C1A2699A9D27D666CD88E42B4 present]: Dependency Apt_key[Add key: 46095ACC8548582C1A2699A9D27D666CD88E42B4 from Apt::Source elastic-7] has failures: true

Expected Behavior

Be able to provide proxy information when using "source" parameter to key.

Environment

Additional Context

Thw workaround I have for now is to use

      key      => {
        'id'      => '46095ACC8548582C1A2699A9D27D666CD88E42B4',
        'server'  => 'keyserver.ubuntu.com',
        'options' => "http-proxy=\"http://${::location}-aptcacher-001.mydomain.com:3142\"",
      },

But this works only when the key is available in keyserver.ubuntu.com

brightdroid commented 2 years ago

I think it should use configured apt::proxy. Thank you in advance.

github-actions[bot] commented 1 year ago

Hello! 👋

This issue has been open for a while and has had no recent activity. We've labelled it with attention-needed so that we can get a clear view of which issues need our attention.

If you are waiting on a response from us we will try and address your comments on a future Community Day.

Alternatively, if it is no longer relevant to you please close the issue with a comment.

dhs-rec commented 1 year ago

BTW: Why does this have a proxy setting at all? Couldn't it be taken from Puppet config?

dhs-rec commented 1 year ago

This needs to be overhauled anyway because of #1034.