f13f3cfac7
Based on code review change exec from apt update to apt_update.
34 lines
834 B
Puppet
34 lines
834 B
Puppet
# ppa.pp
|
|
|
|
define apt::ppa(
|
|
$release = $::lsbdistcodename
|
|
) {
|
|
|
|
Class['apt'] -> Apt::Ppa[$title]
|
|
|
|
include apt::params
|
|
include apt::update
|
|
|
|
$sources_list_d = $apt::params::sources_list_d
|
|
|
|
if ! $release {
|
|
fail('lsbdistcodename fact not available: release parameter required')
|
|
}
|
|
|
|
|
|
$filename_without_slashes = regsubst($name,'/','-','G')
|
|
$filename_without_ppa = regsubst($filename_without_slashes, '^ppa:','','G')
|
|
$sources_list_d_filename = "${filename_without_ppa}-${release}.list"
|
|
|
|
exec { "add-apt-repository-${name}":
|
|
command => "/usr/bin/add-apt-repository ${name}",
|
|
creates => "${sources_list_d}/${sources_list_d_filename}",
|
|
notify => Exec['apt_update'],
|
|
}
|
|
|
|
file { "${sources_list_d}/${sources_list_d_filename}":
|
|
ensure => file,
|
|
require => Exec["add-apt-repository-${name}"];
|
|
}
|
|
}
|
|
|