- exec { "/usr/bin/add-apt-repository ${name}":
- require => Package["python-software-properties"],
- notify => Exec["apt-update"]
- }
-}
+ $filename_without_slashes = regsubst($name, '/', '-', G)
+ $filename_without_dots = regsubst($filename_without_slashes, '\.', '_', G)
+ $filename_without_ppa = regsubst($filename_without_dots, '^ppa:', '', G)
+ $sources_list_d_filename = "${filename_without_ppa}-${release}.list"
+
+ $package = $::lsbdistrelease ? {
+ /^[1-9]\..*|1[01]\..*|12.04$/ => 'python-software-properties',
+ default => 'software-properties-common',
+ }
+
+ if ! defined(Package[$package]) {
+ package { $package: }
+ }