apt: Fix apt::ppa for newer Ubuntus

This commit is contained in:
Ossi Salmi 2014-12-18 16:56:53 +02:00
parent 045fa50765
commit d2f9e2ba7c

View file

@ -20,8 +20,14 @@ class apt {
# #
class apt::ppa::helper { class apt::ppa::helper {
package { "python-software-properties": if $::operatingsystem == "Ubuntu" and versioncmp($::operatingsystemrelease, "12.04") < 0 {
ensure => installed, package { "python-software-properties":
ensure => installed,
}
} else {
package { "software-properties-common":
ensure => installed,
}
} }
} }
@ -41,12 +47,13 @@ class apt::ppa::helper {
# #
# apt::ppa { "ppa:igraph/ppa": } # apt::ppa { "ppa:igraph/ppa": }
# #
define apt::ppa($ensure = "present") { define apt::ppa($ensure="present") {
tag("bootstrap") tag("bootstrap")
include apt include apt
include apt::ppa::helper require apt::ppa::helper
$fname = regsubst($name, "^ppa:([^/]+)/(.+)", "\\1-\\2-${::lsbdistcodename}.list") $fname = regsubst($name, "^ppa:([^/]+)/(.+)", "\\1-\\2-${::lsbdistcodename}.list")
case $ensure { case $ensure {
@ -55,8 +62,7 @@ define apt::ppa($ensure = "present") {
path => "/bin:/usr/bin:/sbin:/usr/sbin", path => "/bin:/usr/bin:/sbin:/usr/sbin",
user => "root", user => "root",
creates => "/etc/apt/sources.list.d/${fname}", creates => "/etc/apt/sources.list.d/${fname}",
require => Package["python-software-properties"], notify => Exec["apt-get update"],
notify => Exec["apt-get-update"],
} }
} }
"absent": { "absent": {