Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

fix repo key updates on each puppet run #35

Open
wants to merge 1 commit into
base: master
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
14 changes: 8 additions & 6 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,20 @@
path => "/etc/apt/sources.list.d/${normalized_name}.list",
mode => '0644',
content => template('packagecloud/apt.erb'),
}
notify => Exec["apt_key_add_${normalized_name}"],
} ->

exec { "apt_key_add_${normalized_name}":
command => "wget --auth-no-challenge -qO - ${base_url}/${repo_name}/gpgkey | apt-key add -",
path => '/usr/bin/:/bin/',
require => File[$normalized_name],
}
refreshonly => true,
notify => Exec["apt_get_update_${normalized_name}"],
} ->

exec { "apt_get_update_${normalized_name}":
command => "apt-get update -o Dir::Etc::sourcelist=\"sources.list.d/${normalized_name}.list\" -o Dir::Etc::sourceparts=\"-\" -o APT::Get::List-Cleanup=\"0\"",
path => '/usr/bin/:/bin/',
require => Exec["apt_key_add_${normalized_name}"],
refreshonly => true,
}
}
default: {
Expand Down Expand Up @@ -136,12 +138,12 @@
path => "/etc/yum.repos.d/${normalized_name}.repo",
mode => '0644',
content => template('packagecloud/yum.erb'),
}
notify => Exec["yum_make_cache_${repo_name}"],
} ->

exec { "yum_make_cache_${repo_name}":
command => "yum -q makecache -y --disablerepo='*' --enablerepo='${normalized_name}'",
path => '/usr/bin',
require => File[$normalized_name],
}
}

Expand Down