Added apt::ppa which installs Ubuntu PPA archives.
This commit is contained in:
parent
9c58553bf5
commit
c31e4360f4
1 changed files with 56 additions and 0 deletions
|
@ -16,6 +16,62 @@ class apt {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Install common packages for using PPA's.
|
||||||
|
#
|
||||||
|
class apt::ppa::helper {
|
||||||
|
|
||||||
|
package { "python-software-properties":
|
||||||
|
ensure => installed,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Add PPA archive to system.
|
||||||
|
#
|
||||||
|
# === Parameters
|
||||||
|
#
|
||||||
|
# $name:
|
||||||
|
# PPA name. Needs to be in format "ppa:user/ppa-name".
|
||||||
|
#
|
||||||
|
# $ensure:
|
||||||
|
# Ensure archive is absent or present. Defaults to present.
|
||||||
|
#
|
||||||
|
# === Sample usage
|
||||||
|
#
|
||||||
|
# apt::ppa { "ppa:igraph/ppa": }
|
||||||
|
#
|
||||||
|
define apt::ppa($ensure = "present") {
|
||||||
|
|
||||||
|
tag("bootstrap")
|
||||||
|
|
||||||
|
include apt::ppa::helper
|
||||||
|
$fname = gsub($name, "^ppa:([^\/]+)\/(.+)", "\\1-\\2-${lsbdistcodename}.list")
|
||||||
|
|
||||||
|
case $ensure {
|
||||||
|
"present": {
|
||||||
|
exec { "add-apt-repository ${name}":
|
||||||
|
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||||
|
user => "root",
|
||||||
|
creates => $fname,
|
||||||
|
require => Package["python-software-properties"],
|
||||||
|
notify => Exec["apt-get-update"],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"absent": {
|
||||||
|
file { $fname:
|
||||||
|
ensure => absent,
|
||||||
|
notify => Exec["apt-get-update"],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
fail("test")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Configure /etc/apt/sources.list
|
# Configure /etc/apt/sources.list
|
||||||
#
|
#
|
||||||
# === Global variables
|
# === Global variables
|
||||||
|
|
Loading…
Add table
Reference in a new issue