From d2f9e2ba7c8d9560e3c6362ceada8111384d9449 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Thu, 18 Dec 2014 16:56:53 +0200 Subject: [PATCH] apt: Fix apt::ppa for newer Ubuntus --- apt/manifests/init.pp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/apt/manifests/init.pp b/apt/manifests/init.pp index 1b7b218..2a449be 100644 --- a/apt/manifests/init.pp +++ b/apt/manifests/init.pp @@ -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": {