default: { fail('Valid values for disable_keys are true or false') }
}
- $proxy_set = $proxy_host ? {
- undef => absent,
- default => present
- }
-
- file { '01proxy':
- ensure => $proxy_set,
- path => "${apt_conf_d}/01proxy",
- content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";\n",
- notify => Exec['apt_update'],
- mode => '0644',
- owner => root,
- group => root,
+ case $proxy_host {
+ false, '', undef: {
+ file { '01proxy':
+ ensure => absent,
+ path => "${apt_conf_d}/01proxy",
+ content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";\n",
+ notify => Exec['apt_update'],
+ mode => '0644',
+ owner => root,
+ group => root,
+ }
+ }
+ default: {
+ file { '01proxy':
+ ensure => present,
+ path => "${apt_conf_d}/01proxy",
+ notify => Exec['apt_update'],
+ }
+ }
}
file { 'old-proxy-file':
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 = []