Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using Apt class to avoid duplicate declaration and use conf.d file to make Apt use the proxy #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions manifests/package/apt.pp
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# package/apt.pp (private class)
# Uses the puppetlabs-apt module to manage apt package manager proxies
# https://forge.puppetlabs.com/puppetlabs/apt
# Writes a conf.d file to make Apt use the proxy
class httpproxy::package::apt {

class { '::apt':
proxy => {
'ensure' => $httpproxy::packagemanager::ensure,
'host' => $httpproxy::http_proxy,
'port' => $httpproxy::http_proxy_port,
},
file { 'apt_via_proxy':
ensure => $httpproxy::packagemanager::ensure,
path => '/etc/apt/apt.conf.d/05proxy',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/puppetlabs/puppetlabs-apt/blob/v7.1.0/manifests/init.pp#L194

I suggest /etc/apt/apt.conf.d/01proxy so that we don't end up with 2 files when converting and maintain backwards compatability

owner => 'root',
group => 'root',
mode => '0644',
content => "Acquire::http::Proxy \"http://${httpproxy::http_proxy}:${httpproxy::http_proxy_port}\";",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old way also does an apt::update: https://github.com/puppetlabs/puppetlabs-apt/blob/main/manifests/setting.pp#L63

Are we ok with losing that functionality?

contain '::apt'
}