forked from voxpupuli/puppet-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapt.pp
More file actions
51 lines (45 loc) · 1.49 KB
/
apt.pp
File metadata and controls
51 lines (45 loc) · 1.49 KB
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
44
45
46
47
48
49
50
51
# PRIVATE CLASS: Do not use directly.
class nodejs::repo::nodesource::apt {
$ensure = $nodejs::repo::nodesource::ensure
$priority = $nodejs::repo::nodesource::priority
$url_suffix = $nodejs::repo::nodesource::url_suffix
include apt
if ($ensure != 'absent') {
apt::keyring { 'nodesource':
source => 'https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key',
filename => 'nodesource-repo.gpg.key.asc',
}
apt::source { 'nodesource':
source_format => 'sources',
location => ["https://deb.nodesource.com/node_${url_suffix}",],
keyring => '/etc/apt/keyrings/nodesource-repo.gpg.key.asc',
release => ['nodistro',],
repos => ['main',],
types => ['deb',],
require => Apt::Keyring['nodesource'],
}
apt::pin { 'nodesource':
origin => 'deb.nodesource.com',
priority => $priority,
}
Apt::Source['nodesource'] -> Package<| tag == 'nodesource_repo' |>
Class['Apt::Update'] -> Package<| tag == 'nodesource_repo' |>
}
else {
apt::source { 'nodesource':
ensure => 'absent',
}
# Workaround https://github.com/puppetlabs/puppetlabs-apt/issues/1245
file { '/etc/apt/sources.list.d/nodesource.sources':
ensure => 'absent',
notify => Class['Apt::Update'],
}
apt::pin { 'nodesource':
ensure => 'absent',
}
apt::keyring { 'nodesource':
ensure => 'absent',
filename => 'nodesource-repo.gpg.key.asc',
}
}
}