forked from evolvingweb/puppet-apt
-
Notifications
You must be signed in to change notification settings - Fork 466
/
Copy pathauth.pp
43 lines (41 loc) · 1005 Bytes
/
auth.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# @summary Manages the Apt auth conf in /etc/apt/auth.conf.d/.
#
# @example Install the puppetlabs apt auth
# apt::auth { 'puppetlabs':
# machine => 'apt.puppetlabs.com',
# login => 'apt',
# password => 'password',
# }
#
# @param ensure
# Specifies whether the Apt auth file should exist. Valid options: 'present' and 'absent'.
#
# @param machine
# The machine entry specifies the auth URI.
#
# @param login
# The username to be used.
#
# @param password
# The password to be used.
#
define apt::auth (
String $ensure = 'present',
String $machine = $name,
String $login = undef,
String $password = undef,
) {
$content = epp('apt/auth_conf.d.epp',
machine => $machine,
login => $login,
password => $password
)
file { "${apt::auth_conf_d}/${name}.conf":
ensure => $ensure,
owner => $apt::auth_conf_owner,
group => 'root',
mode => '0600',
content => Sensitive($content),
notify => Class['apt::update'],
}
}