forked from evolvingweb/puppet-apt
-
Notifications
You must be signed in to change notification settings - Fork 461
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support managing login configurations in /etc/apt/auth.conf
APT 1.5 formally introduced support for specifying login configuration settings (like username and password) for APT sources or proxies that require authentication in the file `/etc/apt/auth.conf`. This file follows a netrc-like format (like ftp or curl) and has restrictive permissions. This is preferable to embedding login information directly in sources.list entries (which are usually world-readable). See https://manpages.debian.org/testing/apt/apt_auth.conf.5.en.html for details. This change adds a new, optional class parameter `apt::auth_conf_entries` which expects an array of hashes (defined by a new abstract data type `Apt::Auth_conf_entry`) that represent sets of login configuration settings to record in `/etc/apt/auth.conf`. The file's contents are rendered using a simple EPP template. Contains updated spec tests and documentation.
- Loading branch information
Showing
6 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
$ppas = {} | ||
$pins = {} | ||
$settings = {} | ||
$auth_conf_entries = [] | ||
|
||
$config_files = { | ||
'conf' => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<% if $apt::auth_conf_entries != [] { -%> | ||
<% $apt::auth_conf_entries.each | $auth_conf_entry | { -%> | ||
machine <%= $auth_conf_entry['machine'] %> login <%= $auth_conf_entry['login'] %> password <%= $auth_conf_entry['password'] %> | ||
<% } -%> | ||
<% } -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
type Apt::Auth_conf_entry = Struct[{ machine => String[1], login => String, password => String }] |