define apt::ppa(
$ensure = 'present',
$release = $::lsbdistcodename,
- $options = '-y'
+ $options = $apt::params::ppa_options,
) {
include apt::params
include apt::update
fail('lsbdistcodename fact not available: release parameter required')
}
+ if $::operatingsystem != 'Ubuntu' {
+ fail('apt::ppa is currently supported on Ubuntu only.')
+ }
+
$filename_without_slashes = regsubst($name, '/', '-', 'G')
$filename_without_dots = regsubst($filename_without_slashes, '\.', '_', 'G')
$filename_without_ppa = regsubst($filename_without_dots, '^ppa:', '', 'G')
if defined(Class[apt]) {
$proxy_host = $apt::proxy_host
$proxy_port = $apt::proxy_port
- case $proxy_host {
- false, '': {
+ case $proxy_host {
+ false, '', undef: {
$proxy_env = []
- }
- default: {$proxy_env = ["http_proxy=http://${proxy_host}:${proxy_port}", "https_proxy=http://${proxy_host}:${proxy_port}"]}
+ }
+ default: {
+ $proxy_env = ["http_proxy=http://${proxy_host}:${proxy_port}", "https_proxy=http://${proxy_host}:${proxy_port}"]
+ }
}
} else {
$proxy_env = []