Skip to content
This repository was archived by the owner on Feb 19, 2024. It is now read-only.
Open
Changes from 1 commit
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
29 changes: 15 additions & 14 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,21 @@
repo_name => $repo_name,
}
}
'deb': {
$osname = downcase($::operatingsystem)
case $osname {
'debian', 'ubuntu': {

$component = 'main'
$repo_url = "${base_url}/${repo_name}/${osname}"
$distribution = $::lsbdistcodename

file { $normalized_name:
ensure => file,
path => "/etc/apt/sources.list.d/${normalized_name}.list",
mode => '0644',
content => template('packagecloud/apt.erb'),
} elsif $type == 'deb' {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This line should be changed back to 'deb': { because we're in case statement here, not an if/else block. :)

$osname = downcase($::operatingsystem)
case $osname {
'debian', 'ubuntu': {

$component = 'main'
$repo_url = "${base_url}/${repo_name}/${osname}"
$distribution = $::lsbdistcodename

apt::source {"${normalized_name}":

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The require => File[$normalized_name] line should now also be removed from Exec["apt_key_add_${normalized_name}"] a bit further down, since File[$normalized_name] has now been replaced with an apt::source resource.

location => "${repo_url}",
repos => "${component}",
key => {
'id' => '418A7F2FB0E1E6E7EABF6FE8C2E73424D59097AB',
'server' => 'pgp.mit.edu'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unfortunately, we can't use pgp.mit.edu. We used to use this in the past, but it goes down very, very often and it breaks most of our user's CI/CD/deploys when that happens.

}

exec { "apt_key_add_${normalized_name}":
Expand Down