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

(MODULES-11173) Add per-host overrides for apt::proxy #1007

Closed maturnbull closed 2 years ago

maturnbull commented 3 years ago

Add support for optional apt::proxy::perhost array to configure bypass (DIRECT) or alternative proxy for specific repository hosts.

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

puppet-community-rangefinder[bot] commented 3 years ago

apt is a class

Breaking changes to this file WILL impact these 238 modules (exact match): * [a2tar-nodejs](https://github.com/a2tar/puppet_nodejs.git) * [elithrar-golang](https://github.com/elithrar/puppet-golang-backports.git) * [kritz-vagrantlamp](https://github.com/kritznl/vagrantlamp) * [garethr-pypy](https://github.com/garethr/garethr-pypy.git) * [jcustenborder-confluent](https://github.com/jcustenborder/puppet-confluent) * [puppetlabs-docker](https://github.com/puppetlabs/puppetlabs-docker) * [johnlawerance-crucible](https://github.com/johnlawerance/crucible.git) * [deviseit-barman](https://github.com/deviseit/puppet-barman.git) * [fschaer-omd](https://github.com/GRIF-IRFU/puppet-omd) * [tanny1910-omd](https://github.com/GRIF-IRFU/puppet-omd.git) * [cpick-hub](https://github.com/cpick/puppet-hub.git) * [mvisonneau-curator](https://github.com/mvisonneau/puppet-curator) * [puppetfinland-mysql](https://github.com/Puppet-Finland/puppet-mysql.git) * [TubeMogul-aptly](https://github.com/tubemogul/puppet-aptly.git) * [abstractit-puppet](https://github.com/abstractitptyltd/abstractit-puppet) * [artberri-yarn](https://github.com/artberri/puppet-yarn) * [driebit-zotonic](https://github.com/driebit/puppet-zotonic.git) * [puppet-collectd](https://github.com/voxpupuli/puppet-collectd) * [norisnetwork-heartbeat](https://github.com/noris-network/norisnetwork-heartbeat) * [camptocamp-puppetserver](https://github.com/camptocamp/puppet-puppetserver) * [chartbeat-confluent_kafka](http://github.com/chartbeat-labs/puppet-confluent-kafka) * [deric-java_binary](https://github.com/deric/puppet-java/archive/master.zip) * [nrvale0-keepass2](https://github.com/nrvale0/puppet-keepass2) * [tsuru-base](https://github.com/tsuru/puppet-tsuru) * [theforeman-foreman](https://github.com/theforeman/puppet-foreman) * [deric-fhgfs](https://github.com/deric/puppet-fhgfs) * [gajdaw-symfony](https://github.com/puppet-by-examples/puppet-symfony) * [oris-nginx](https://bitbucket.org/oris/env-puppet-module-nginx) * [abaranov-wireguard](https://github.com/spacedog/puppet-wirguard) * [spjmurray-ceph](https://github.com/spjmurray/puppet-ceph) * [johnlawerance-xtrabackup](https://github.com/johnlawerance/xtrabackup) * [codingfuture-cfsystem](https://github.com/codingfuture/puppet-cfsystem) * [zivtech-rethinkdb](https://github.com/zivtech/puppet-rethinkdb.git) * [aageyev-redis](https://bitbucket.org/aageyev/redis) * [a2labs-nginx](https://aageyev@bitbucket.org/a2labs/nginx.git) * [locp-opscenter](https://github.com/locp/opscenter) * [puppet-puppetserver](https://github.com/voxpupuli/puppet-puppetserver) * [edestecd-mariadb](https://github.com/edestecd/puppet-mariadb.git) * [potto-marathon](http://github.com/potto007/puppet-marathon) * [puppet-rsyslog](https://github.com/voxpupuli/puppet-rsyslog) * [monkygames-landscape](https://bitbucket.org/monkygames/puppet-landscape.git) * [garethr-docker](https://github.com/garethr/garethr-docker.git) * [petems-cockpit](https://github.com/petems/petems-cockpit) * [praekeltfoundation-webupd8_oracle_java](https://github.com/praekeltfoundation/puppet-webupd8_oracle_java) * [puppet-unattended_upgrades](https://github.com/voxpupuli/puppet-unattended_upgrades.git) * [dmcnicks-mcoconfig](http://github.com/dmcnicks/dmcnicks-mcoconfig) * [dowlingw-nvidia](https://github.com/dowlingw/puppet-nvidia) * [spjmurray-jenkins](https://github.com/spjmurray/puppet-jenkins) * [brwyatt-syncthing](https://github.com/brwyatt/puppet-syncthing.git) * [pcfens-filebeat](https://github.com/pcfens/puppet-filebeat) * [garethr-mirageos](https://github.com/garethr/garethr-mirageos.git) * [neo4j-neo4j](https://github.com/simpsonjulian/puppet-neo4j) * [deric-torque](https://github.com/deric/puppet-torque.git) * [jcalles-php](https://github.com/mayflower/puppet-php) * [razorsedge-cloudera](https://github.com/razorsedge/puppet-cloudera.git) * [willdurand-bazinga](https://forge.puppet.com/willdurand/bazinga) * [vide-omsa](https://github.com/vide/puppet-omsa) * [igovua-nodejs](https://bitbucket.org/egovinfrastructure/puppet_module_nodejs.git) * [rpignolet-mongodb](https://github.com/rpignolet/puppetlabs-mongodb.git) * [a2tar-dnsmasq](https://github.com/a2tar/dnsmasq.git) * [ncorrare-yubikey](https://github.com/ncorrare/ncorrare-yubikey) * [flatline235-aptsimplesoftware](https://github.com/flat235/puppet-aptsimplesoftware.git) * [garethr-erlang](https://github.com/garethr/garethr-erlang.git) * [s12v-blackfire](https://github.com/s12v/puppet-blackfire) * [joelkle-salt](https://github.com/JoelKle/puppet-salt) * [bfraser-grafana](https://github.com/bfraser/puppet-grafana.git) * [lesaux-kibana4](https://github.com/lesaux/puppet-kibana4.git) * [continuent-tungsten](https://github.com/continuent/continuent-tungsten) * [cristaldo-libreoffice](https://github.com/cristaldo/libreoffice.git) * [tsuru-tsuru](https://github.com/tsuru/puppet-tsuru) * [giavac-homer](https://github.com/giavac/giavac-homer) * [petems-fish](https://github.com/petems/petems-fish) * [horsefish-bmc](https://github.com/horsefish/bmc) * [deric-java](https://github.com/deric/puppet-java/archive/master.zip) * [initforthe-yarn](https://github.com/initforthe/puppet-yarn) * [rtyler-puppet](https://github.com/rtyler/puppet-puppet.git) * [pcfens-topbeat](https://github.com/pcfens/puppet-topbeat) * [4n0m4l0u5-configure_nginx](https://github.com/4n0m4l0u5/configure_nginx) * [locp-cassandra](https://github.com/locp/cassandra) * [vshn-gitlab](https://github.com/vshn/puppet-gitlab) * [MiamiOH-httpproxy](https://github.com/MiamiOH/puppet-httpproxy.git) * [helio-fluentbit](https://github.com/helio/puppet-fluentbit) * [fortin-tor](https://github.com/shaftoe/puppet-tor) * [vpgrp-omsa](https://git.vpgrp.io/puppet/puppet-omsa) * [hfm-h2o](https://github.com/hfm/puppet-h2o) * [a2labs-php](https://bitbucket.org/a2labs/php.git) * [spantree-java8](https://github.com/Spantree/puppet-java8.git) * [spantree-java7](https://github.com/Spantree/puppet-java7.git) * [oxc-rspamd](https://github.com/oxc/puppet-rspamd) * [binarin-workstation](https://forge.puppet.com/binarin/workstation) * [midonet-midonet](https://github.com/midonet/puppet-midonet) * [puppetfinland-xtrabackup](https://github.com/Puppet-Finland/puppet-xtrabackup.git) * [cheasles-synapse](https://github.com/cheasles/puppet-synapse.git) * [cesnet-java_ng](https://github.com/MetaCenterCloudPuppet/cesnet-java_ng) * [a2tar-openvpn](https://github.com/a2tar/openvpn.git) * [vholer-hp_sdr](https://github.com/vholer/puppet-hp_sdr.git) * [rehan-nginx](https://github.com/rehanone/puppet-nginx.git) * [edestecd-software](https://github.com/edestecd/puppet-software.git) * [arioch-redis](https://github.com/arioch/puppet-redis) * [kogitoapp-chronograf](https://github.com/kogitoapp/puppet-chronograf) * [garethr-golang](https://github.com/garethr/garethr-golang.git) * [elastic-elastic_stack](https://github.com/elastic/puppet-elastic-stack) * [desertkun-nginx](https://github.com/desertkun/puppet-nginx.git) * [BradChesney79-arduino](https://github.com/bradchesney79/arduino) * [vpgrp-influxdb](https://github.com/veepee-puppet/puppet-influxdb) * [alanpetersen-helix](https://github.com/alanpetersen/helix) * [puppetlabs-puppet_agent](https://github.com/puppetlabs/puppetlabs-puppet_agent) * [dsestero-sonarqube](https://github.com/dsestero/sonarqube.git) * [justintw-developer_environment](https://github.com/JustinTW/justintw-developer_environment) * [darkmantle-java](https://github.com/darkmantle/puppet-java) * [shoekstra-owncloud](https://github.com/shoekstra/puppet-owncloud.git) * [factorit-jasperreports_server](https://github.com/jbbrunsveld/jasperreports_server) * [walkamongus-pdagent](https://github.com/walkamongus/puppet-pdagent.git) * [chartbeat-varnish](https://github.com/chartbeat-labs/puppet-varnish) * [covata-safeshare](https://bitbucket.org/covata/puppet_covata_services) * [bluesman-crossbar](https://github.com/blues-man/crossbar-puppet.git) * [dsestero-java](https://github.com/dsestero/java.git) * [deric-r](https://github.com/deric/deric-r) * [Siteminds-gogs](https://github.com/Siteminds/puppet-gogs.git) * [TubeMogul-druid](https://github.com/tubemogul/puppet-druid.git) * [abstractit-icinga](https://github.com/abstractitptyltd/abstractit-icinga) * [deric-mesos](http://github.com/deric/puppet-mesos) * [project0-bareos](https://github.com/project0/puppet-bareos) * [opstudio-duplicity](https://git.opstudio.pro/modules/duplicity.git) * [danzilio-virtualbox](https://github.com/danzilio/danzilio-virtualbox) * [tracywebtech-java](https://github.com/TracyWebTech/puppet-java) * [puppet-tvheadend](https://github.com/voxpupuli/puppet-tvheadend.git) * [memoussati-postgresql](https://github.com/puppetlabs/puppetlabs-postgresql.git) * [badquanta-badstation](https://github.com/BadQuanta/badquanta-badstation) * [locp-odoo](https://github.com/locp/puppet-odoo) * [basholabs-riak](https://github.com/basho-labs/puppet-riak) * [jfryman-nginx](https://github.com/jfryman/puppet-nginx.git) * [rehan-git](https://github.com/rehanone/puppet-git.git) * [loomsen-bloonix_agent](https://github.com/loomsen/puppet-bloonix_agent) * [garethr-rustlang](https://github.com/garethr/garethr-rustlang.git) * [puppet-hashi_stack](https://github.com/voxpupuli/puppet-hashi_stack) * [puppet-mongodb](https://github.com/voxpupuli/puppet-mongodb) * [Envek-erlang](https://github.com/Envek/puppet-erlang.git) * [kallies-x2go](https://github.com/kallies/puppet-x2go.git) * [cethy-gaudi](https://github.com/cethy/cethy-gaudi.git) * [pest-curator](https://github.com/puppets-epic-show-theatre/puppet-curator) * [thbe-bareos](https://github.com/thbe/puppet-bareos.git) * [bjorns-acmd](https://github.com/bjorns/aem-cmd) * [openstack-ceph](https://github.com/openstack/puppet-ceph.git) * [instana-agent](https://github.com/instana/instana-agent-puppet) * [fnerdwq-omd](https://github.com/fnerdwq/puppet-omd.git) * [cloudpassage-cloudpassage](https://github.com/cloudpassage/puppet-cloudpassage.git) * [alanpetersen-gitfusion](https://github.com/alanpetersen/gitfusion) * [mvasilenko-docker](https://github.com/mvasilenko/garethr-docker.git) * [praekeltfoundation-xylem](https://github.com/praekeltfoundation/puppet-xylem) * [cmantix-nginxphp](https://bitbucket.org/hfraser/puppet-nginx-php) * [guimaluf-gvpe](https://github.com/guimaluf/puppet-gvpe) * [puppetfinland-freight](https://github.com/Puppet-Finland/puppet-freight.git) * [gwaldvogel-liveconfig](https://github.com/gwaldvogel/puppet-liveconfig) * [ericsysmin-oraclejava](https://github.com/ericsysmin/ericsysmin-oraclejava) * [mayflower-php](https://github.com/mayflower/puppet-php) * [nexcess-ksplice](https://github.com/nexcess/puppet-ksplice) * [southernhill-phpldapadmin](https://github.com/southernhill/puppet-phpldapadmin.git) * [puppet-bareos](https://github.com/voxpupuli/puppet-bareos) * [wywygmbh-fluentd](https://github.com/wywy/puppet-fluentd) * [adcade-java7](https://forge.puppet.com/adcade/java7) * [puppetfinland-openvpn](https://github.com/Puppet-Finland/puppet-openvpn.git) * [vpgrp-docker](https://git.vpgrp.io/puppet/puppet-docker) * [lookatitude-zserver](https://github.com/lookatitude/Zserver) * [threatstack-threatstack](https://github.com/threatstack/threatstack-puppet) * [nono-zfs](https://forge-git.ircam.fr/puppet-module-base-zfs.git) * [rtyler-jenkins](https://github.com/jenkinsci/puppet-jenkins) * [cyberkov-openhab](https://github.com/cyberkov/puppet-openhab) * [garethr-sysdig](https://github.com/garethr/garethr-sysdig.git) * [praekeltfoundation-gluster](https://github.com/praekeltfoundation/puppet-gluster) * [ngiger-x2go](https://forge.puppet.com/ngiger/x2go) * [vll-synergy](https://github.com/indigo-dc/puppet-synergy) * [puppetlabs-postgresql](https://github.com/puppetlabs/puppetlabs-postgresql) * [cesnet-site_hadoop](https://github.com/MetaCenterCloudPuppet/cesnet-site_hadoop) * [devsec-suricata](https://github.com/odinje/puppet-suricata) * [justintw-develop_environment](https://github.com/JustinTW/justintw-develop_environment) * [sensson-powerdns](https://github.com/sensson/puppet-powerdns) * [trepasi-kibana5](https://github.com/rtib/puppet-kibana5) * [elasticsearch-elasticsearch](https://github.com/elastic/puppet-elasticsearch) * [brwyatt-flatpak](https://github.com/brwyatt/puppet-flatpak) * [midonet-cassandra](https://github.com/midonet/puppet-cassandra) * [stevenrombauts-logdna](https://github.com/stevenrombauts/puppet-logdna.git) * [continuent-percona_repo](https://github.com/continuent/continuent-percona_repo) * [marcdeop-ratticdb](https://github.com/marcdeop/ratticdb) * [signalfx-collectd](https://github.com/signalfx/puppet_collectd) * [ploperations-puppetlabs_apt](https://github.com/puppetlabs-operations/puppet-puppetlabs_apt) * [icinga-icinga](https://github.com/icinga/puppet-icinga) * [tmont-rethinkdb](https://github.com/tmont/puppet-rethinkdb) * [trulabs-kamailio](https://github.com/trulabs/puppet-kamailio) * [markb-docker_registry](https://forge.puppet.com/markb/docker_registry) * [puppet-gluster](https://github.com/voxpupuli/puppet-gluster.git) * [rfletcher-ec2_consistent_snapshot](https://forge.puppet.com/rfletcher/ec2_consistent_snapshot) * [puppet-virtualbox](https://github.com/voxpupuli/puppet-virtualbox) * [robinvdvleuten-phpenv](https://github.com/RobinvdVleuten/puppet-phpenv) * [dowlingw-kodi](https://github.com/dowlingw/puppet-kodi) * [deric-beegfs](https://github.com/deric/puppet-beegfs) * [jeoffreybauvin-gitlab_ci_multi_runner](https://github.com/Jeoffreybauvin/gitlab-ci-multi-runner) * [krakatoa-haproxy](https://github.com/krakatoa1987/puppetlabs-haproxy) * [puppet-jenkins](https://github.com/voxpupuli/puppet-jenkins) * [puppetlabs-mongodb](https://github.com/puppetlabs/puppetlabs-mongodb) * [puppet-cassandra](https://github.com/voxpupuli/puppet-cassandra) * [binarin-binarin](https://forge.puppet.com/binarin/binarin) * [puppet-php](https://github.com/voxpupuli/puppet-php) * [norisnetwork-packetbeat](https://github.com/noris-network/norisnetwork-packetbeat) * [ape-elasticsearch](https://github.com/pecharmin/puppet-elasticsearch) * [otherskins-ansible](https://github.com/otherskins/puppet-ansible.git) * [spantree-nginx](https://github.com/Spantree/puppet-nginx) * [mindhive-nvidia_docker_runtime](https://github.com/mindhivenz/nvidia_docker_runtime) * [bashtoni-varnish](https://github.com/BashtonLtd/puppet-varnish) * [fe80-java](https://github.com/fe80/puppet-java.git) * [a2tar-redis](https://github.com/a2tar/redis.git) * [praekeltfoundation-consular](https://github.com/praekeltfoundation/puppet-consular) * [whefter-syncthing](https://github.com/whefter/puppet-syncthing.git) * [qroac-isp3node](https://github.com/qroac/puppet-ispconfig) * [memoussati-docker](https://github.com/garethr/garethr-docker.git) * [garethr-nginx](https://github.com/garethr/garethr-nginx.git) * [hfm-percona](https://github.com/hfm/puppet-percona) * [meeh-java](https://github.com/meeh420/puppet-java.git) * [puppet-zabbix](https://github.com/voxpupuli/puppet-zabbix.git) * [jlambert121-curator](https://github.com/jlambert121/jlambert121-curator) * [cristifalcas-curator](https://github.com/cristifalcas/puppet-curator) * [aageyev-nodejs](https://bitbucket.org/aageyev/nodejs) * [factorit-grafana](https://github.com/bfraser/puppet-grafana.git) * [hackerhappyhour-docker](https://github.com/HackerHappyHour/hackerhappyhour-docker.git) * [librato-librato](https://github.com/librato/puppet-librato) * [tapajos-ruby_stable](https://github.com/tapajos/puppet-ruby-stable) * [dalaro-titan](https://forge.puppet.com/dalaro/titan) * [spjmurray-puppet](https://github.com/spjmurray/puppet-puppet) * [spjmurray-kubernetes](https://github.com/spjmurray/puppet-kubernetes) * [locp-odoo9](https://github.com/locp/puppet-odoo) * [norisnetwork-auditbeat](https://github.com/noris-network/norisnetwork-auditbeat) * [joshuaspence-phabricator](https://github.com/joshuaspence/puppet-phabricator) * [wavesoftware-xtreemfs](https://github.com/wavesoftware/puppet-xtreemfs.git) * [alanpetersen-gitswarm](https://github.com/alanpetersen/gitswarm) * [simp-postgresql](https://github.com/simp/puppetlabs-postgresql.git) * [razorsedge-vmwaretools](https://github.com/razorsedge/puppet-vmwaretools.git) * [m3del-sabnzbd](https://github.com/nctiggy/m3del-sabnzbd) * [olivierHa-influxdb](https://github.com/olivierHa/puppet-influxdb)
Breaking changes to this file MAY impact these 47 modules (near match): * [hackerhorse-puppet_deluge](https://github.com/RainbowHackerHorse/puppet_deluge) * [puppet-borg](https://github.com/voxpupuli/puppet-borg.git) * [Firebladee-newrelic](https://github.com/Firebladee/newrelic) * [eyp-postgresql](https://github.com/NTTCom-MS/eyp-postgresql) * [hfm-tinyproxy](https://github.com/hfm/puppet-tinyproxy) * [opendaylight-opendaylight](https://git.opendaylight.org/gerrit/p/integration/packaging/puppet-opendaylight.git) * [gjerjens-zabbix_agent2](https://gitlab.com/gjerjens/zabbix_agent2) * [meltwater-marathon](https://github.com/meltwater/puppet-marathon) * [hfm-proxysql](https://github.com/hfm/puppet-proxysql) * [puppet-redis](https://github.com/voxpupuli/puppet-redis.git) * [elasticsearch-logstashforwarder](https://github.com/elastic/puppet-logstashforwarder) * [nrvale0-openmediavault](https://github.com/nrvale0/puppet-openmediavault.git) * [puppetfinland-hwraid](https://github.com/Puppet-Finland/puppet-hwraid.git) * [puppet-grafana](https://github.com/voxpupuli/puppet-grafana.git) * [puppetfinland-postgresql](https://github.com/Puppet-Finland/puppet-postgresql.git) * [camptocamp-varnish](https://github.com/camptocamp/puppet-varnish) * [eyp-nrpe](https://github.com/NTTCom-MS/eyp-nrpe) * [puppetfinland-nginx](https://github.com/Puppet-Finland/puppet-nginx.git) * [nibalizer-zfs](https://github.com/nibalizer/puppet-module-zfs.git) * [puppetlabs-nodejs](https://github.com/puppetlabs/puppetlabs-nodejs) * [jay-nodejs](https://github.com/mootpt/puppet-nodejs) * [luckyknight-hhvm](https://github.com/craigcarnell/puppet-hhvm.git) * [lwo-dataverse](https://github.com/IQSS/dataverse-puppet) * [nrvale0-plexmediaserver](https://github.com/nrvale0/puppet-plexmediaserver) * [puppet-rundeck](https://github.com/voxpupuli/puppet-rundeck.git) * [vinodverma7584-truesightmeter](https://github.com/VinodVerma7584/boundary_puppet) * [elastic-kibana](https://github.com/elastic/puppet-kibana) * [theforeman-foreman_proxy](https://github.com/theforeman/puppet-foreman_proxy) * [jethrocarr-soe](https://github.com/jethrocarr/puppet-soe) * [elasticsearch-logstash](https://github.com/elastic/puppet-logstash) * [puppet-nodejs](https://github.com/voxpupuli/puppet-nodejs) * [rgevaert-mysql](https://github.com/rgevaert/puppet-mysql) * [eyp-php](https://github.com/NTTCom-MS/eyp-php) * [puppet-nginx](https://github.com/voxpupuli/puppet-nginx.git) * [boundary-boundary](https://github.com/boundary/boundary_puppet) * [puppet-puppetwebhook](https://github.com/voxpupuli/puppet-puppetwebhook.git) * [edgester-buildbot](https://forge.puppet.com/edgester/buildbot) * [camptocamp-dell](https://github.com/camptocamp/puppet-dell) * [sematext-spm_monitor](http://sematext.com) * [geoffwilliams-r_profile](https://github.com/GeoffWilliams/r_profile) * [mvasilenko-sensu](https://github.com/mvasilenko/sensu-puppet) * [factorit-icingaweb2](https://github.com/Icinga/puppet-icingaweb2.git) * [hfm-octopass](https://github.com/hfm/puppet-octopass) * [sensu-sensuclassic](https://github.com/sensu/puppet-module-sensuclassic) * [hfm-stns](https://github.com/STNS/puppet-stns) * [Lavaburn-flapjack](https://github.com/Lavaburn/puppet-flapjack.git) * [aniketmehta-elasticsearch](https://github.com/aniketmehta/elasticsearch)

This module is declared in 234 of 578 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

daianamezdrea commented 2 years ago

Hello @maturnbull, this looks good ! Thank you for your contribution!

lamaral commented 2 years ago

It looks like this change breaks the module when you don't have a proxy set:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Method call, The function 'each' was called with arguments it does not accept. It expects one of:
  (Hash hash, Callable[2, 2] block)
    rejected: parameter 'hash' expects a Hash value, got Undef
  (Hash hash, Callable[1, 1] block)
    rejected: parameter 'hash' expects a Hash value, got Undef
  (Iterable enumerable, Callable[2, 2] block)
    rejected: parameter 'enumerable' expects an Iterable value, got Undef
  (Iterable enumerable, Callable[1, 1] block)
    rejected: parameter 'enumerable' expects an Iterable value, got Undef (file: /etc/puppetlabs/code/environments/testing/modules/apt/templates/proxy.epp, line: 2, column: 23)
maturnbull commented 2 years ago

@lamaral I can't reproduce the problem you're seeing - please can you share more details of the Hiera files and how you're testing? I've tried both with the entire perhost: structure missing, and also with an empty perhost:

lamaral commented 2 years ago

I don't have any apt setup done via Hiera.

I have a couple different repositories declared like this in classes:

apt::source { 'docker':
        location => 'https://download.docker.com/linux/debian',
        repos    => 'stable',
        key      => {
            id     => '9DC858229FC7DD38854AE2D88D81803C0EBFCD88',
            source => 'https://download.docker.com/linux/debian/gpg',
        },
    }

I have no proxy at all configured for them.

After downgrading my apt module from version 8.3.0 to version 8.2.0, the issue is gone.

maturnbull commented 2 years ago

I've tried to reproduce in a clean container, but I don't get the error you're seeing:

% docker run -ti --rm --entrypoint /bin/bash puppet/puppet-agent-ubuntu 
root@25e533fa99e0:/# apt-get -qq update
root@25e533fa99e0:/# apt-get -qq install gpg
<...snip...>

root@25e533fa99e0:/# puppet module install puppetlabs-apt
Notice: Preparing to install into /etc/puppetlabs/code/environments/production/modules ...
Notice: Downloading from https://forgeapi.puppet.com ...
Notice: Installing -- do not interrupt ...
/etc/puppetlabs/code/environments/production/modules
└─┬ puppetlabs-apt (v8.3.0)
  └── puppetlabs-stdlib (v8.1.0)

root@25e533fa99e0:/# cat > test.pp << EOF
> notify { 'testing': }
> 
> apt::source { 'docker':
>     location => 'https://download.docker.com/linux/debian',
>     repos    => 'stable',
>     key      => {
>         id     => '9DC858229FC7DD38854AE2D88D81803C0EBFCD88',
>         source => 'https://download.docker.com/linux/debian/gpg',
>     },
> }
> EOF

root@25e533fa99e0:/# puppet apply --test test.pp 
Info: Loading facts
Info: Loading facts
Notice: Compiled catalog for 25e533fa99e0 in environment production in 0.29 seconds
Info: Using environment 'production'
Info: Applying configuration version '1641425150'
Notice: testing
Notice: /Stage[main]/Main/Notify[testing]/message: defined 'message' as 'testing'
Notice: /Stage[main]/Apt/File[preferences]/ensure: created
Info: /Stage[main]/Apt/File[preferences]: Scheduling refresh of Class[Apt::Update]
Notice: /Stage[main]/Apt/Apt::Setting[conf-update-stamp]/File[/etc/apt/apt.conf.d/15update-stamp]/ensure: defined content as '{sha256}2e6eb1f5f20262bfc6b7dfb26a302f00b4ab5fee803abd9e07ad8378cce067d5'
Info: /Stage[main]/Apt/Apt::Setting[conf-update-stamp]/File[/etc/apt/apt.conf.d/15update-stamp]: Scheduling refresh of Class[Apt::Update]
Notice: /Stage[main]/Main/Apt::Source[docker]/Apt::Key[Add key: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 from Apt::Source docker]/Apt_key[Add key: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 from Apt::Source docker]/ensure: created
Notice: /Stage[main]/Main/Apt::Source[docker]/Apt::Setting[list-docker]/File[/etc/apt/sources.list.d/docker.list]/ensure: defined content as '{sha256}3b763fab36a791b0d8063919462aa38dc61fe3dd4be8acb4900bbe8f31ce0118'
Info: /Stage[main]/Main/Apt::Source[docker]/Apt::Setting[list-docker]/File[/etc/apt/sources.list.d/docker.list]: Scheduling refresh of Class[Apt::Update]
Info: Class[Apt::Update]: Scheduling refresh of Exec[apt_update]
Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: Hit:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: Hit:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: Ign:5 https://download.docker.com/linux/debian bionic InRelease
Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: Err:6 https://download.docker.com/linux/debian bionic Release
Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns:   404  Not Found [IP: 216.137.44.72 443]
Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: Hit:7 http://apt.puppetlabs.com bionic InRelease
Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: Reading package lists...
Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: E: The repository 'https://download.docker.com/linux/debian bionic Release' does not have a Release file.
Error: /Stage[main]/Apt::Update/Exec[apt_update]: Failed to call refresh: '/usr/bin/apt-get update' returned 100 instead of one of [0]
Error: /Stage[main]/Apt::Update/Exec[apt_update]: '/usr/bin/apt-get update' returned 100 instead of one of [0]
Info: Stage[main]: Unscheduling all events on Stage[main]
Notice: Applied catalog in 5.43 seconds

root@25e533fa99e0:/# exit
exit
% 

The catalog compiles and applies fine, the error is only because the repo isn't quite right but that's not relevant to the problem you're seeing. What distribution/version are you using?

lamaral commented 2 years ago

I had this with Debian Buster and Puppet 7.13.1.

Oddly enough, now that I unpinned the version and redownloaded the module, I cant reproduce it either. Thanks for checking it out.

maturnbull commented 2 years ago

No problem, glad it's working now.