2010-04-27 22:38:28 +02:00
|
|
|
# ppa.pp
|
|
|
|
|
2012-02-24 23:03:51 +01:00
|
|
|
define apt::ppa(
|
|
|
|
$release = $lsbdistcodename
|
|
|
|
) {
|
2011-03-11 18:02:50 +01:00
|
|
|
|
2011-05-30 19:22:04 +02:00
|
|
|
Class['apt'] -> Apt::Ppa[$title]
|
2011-03-11 18:02:50 +01:00
|
|
|
|
2012-02-24 23:03:51 +01:00
|
|
|
include apt::params
|
|
|
|
|
|
|
|
if ! $release {
|
2012-03-21 14:20:13 +01:00
|
|
|
fail('lsbdistcodename fact not available: release parameter required')
|
2012-02-24 23:03:51 +01:00
|
|
|
}
|
|
|
|
|
2011-05-30 19:24:06 +02:00
|
|
|
exec { "apt-update-${name}":
|
2012-03-21 14:20:13 +01:00
|
|
|
command => '/usr/bin/aptitude update',
|
2011-05-30 19:24:06 +02:00
|
|
|
refreshonly => true,
|
|
|
|
}
|
2011-03-11 19:14:31 +01:00
|
|
|
|
2012-02-24 23:03:51 +01:00
|
|
|
$filename_without_slashes = regsubst($name,'/','-','G')
|
2012-03-21 14:20:13 +01:00
|
|
|
$filename_without_ppa = regsubst($filename_without_slashes, '^ppa:','','G')
|
|
|
|
$sources_list_d_filename = "${filename_without_ppa}-${release}.list"
|
2012-02-24 23:03:51 +01:00
|
|
|
|
2011-05-30 19:24:06 +02:00
|
|
|
exec { "add-apt-repository-${name}":
|
|
|
|
command => "/usr/bin/add-apt-repository ${name}",
|
|
|
|
notify => Exec["apt-update-${name}"],
|
2012-02-24 23:03:51 +01:00
|
|
|
creates => "${apt::params::sources_list_d}/${sources_list_d_filename}",
|
2011-05-30 19:24:06 +02:00
|
|
|
}
|
2012-02-24 23:03:51 +01:00
|
|
|
|
|
|
|
file { "${apt::params::sources_list_d}/${sources_list_d_filename}":
|
|
|
|
ensure => file,
|
|
|
|
require => Exec["add-apt-repository-${name}"];
|
|
|
|
}
|
|
|
|
|
2010-04-27 22:38:28 +02:00
|
|
|
}
|
|
|
|
|