apt: Fix apt::ppa for newer Ubuntus
This commit is contained in:
parent
045fa50765
commit
d2f9e2ba7c
1 changed files with 12 additions and 6 deletions
|
@ -20,8 +20,14 @@ class apt {
|
|||
#
|
||||
class apt::ppa::helper {
|
||||
|
||||
package { "python-software-properties":
|
||||
ensure => installed,
|
||||
if $::operatingsystem == "Ubuntu" and versioncmp($::operatingsystemrelease, "12.04") < 0 {
|
||||
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": }
|
||||
#
|
||||
define apt::ppa($ensure = "present") {
|
||||
define apt::ppa($ensure="present") {
|
||||
|
||||
tag("bootstrap")
|
||||
|
||||
include apt
|
||||
include apt::ppa::helper
|
||||
require apt::ppa::helper
|
||||
|
||||
$fname = regsubst($name, "^ppa:([^/]+)/(.+)", "\\1-\\2-${::lsbdistcodename}.list")
|
||||
|
||||
case $ensure {
|
||||
|
@ -55,8 +62,7 @@ define apt::ppa($ensure = "present") {
|
|||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
user => "root",
|
||||
creates => "/etc/apt/sources.list.d/${fname}",
|
||||
require => Package["python-software-properties"],
|
||||
notify => Exec["apt-get-update"],
|
||||
notify => Exec["apt-get update"],
|
||||
}
|
||||
}
|
||||
"absent": {
|
||||
|
|
Loading…
Add table
Reference in a new issue