Merge pull request #78 from saz/source-remove-release
remove check, if $release is empty
This commit is contained in:
commit
32d312ea41
3 changed files with 17 additions and 5 deletions
|
@ -4,7 +4,7 @@
|
||||||
define apt::source(
|
define apt::source(
|
||||||
$ensure = present,
|
$ensure = present,
|
||||||
$location = '',
|
$location = '',
|
||||||
$release = $::lsbdistcodename,
|
$release = 'UNDEF',
|
||||||
$repos = 'main',
|
$repos = 'main',
|
||||||
$include_src = true,
|
$include_src = true,
|
||||||
$required_packages = false,
|
$required_packages = false,
|
||||||
|
@ -21,8 +21,14 @@ define apt::source(
|
||||||
$sources_list_d = $apt::params::sources_list_d
|
$sources_list_d = $apt::params::sources_list_d
|
||||||
$provider = $apt::params::provider
|
$provider = $apt::params::provider
|
||||||
|
|
||||||
if $release == undef {
|
if $release == 'UNDEF' {
|
||||||
|
if $::lsbdistcodename == undef {
|
||||||
fail('lsbdistcodename fact not available: release parameter required')
|
fail('lsbdistcodename fact not available: release parameter required')
|
||||||
|
} else {
|
||||||
|
$release_real = $::lsbdistcodename
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$release_real = $release
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${name}.list":
|
file { "${name}.list":
|
||||||
|
|
|
@ -42,6 +42,12 @@ describe 'apt::source', :type => :define do
|
||||||
:location => 'http://example.com',
|
:location => 'http://example.com',
|
||||||
:release => 'precise',
|
:release => 'precise',
|
||||||
:repos => 'security',
|
:repos => 'security',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:release => '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:release => 'custom',
|
||||||
}
|
}
|
||||||
].each do |param_set|
|
].each do |param_set|
|
||||||
describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do
|
describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# <%= name %>
|
# <%= name %>
|
||||||
deb <%= location %> <%= release %> <%= repos %>
|
deb <%= location %> <%= release_real %> <%= repos %>
|
||||||
<%- if include_src then -%>
|
<%- if include_src then -%>
|
||||||
deb-src <%= location %> <%= release %> <%= repos %>
|
deb-src <%= location %> <%= release_real %> <%= repos %>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
|
|
Loading…
Reference in a new issue