Skip to content

Commit d977450

Browse files
committed
Update source_format parameter
Match the possible values to the file suffix of the created source files.
1 parent 2b6694e commit d977450

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

REFERENCE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ apt::source { 'puppetlabs':
10391039

10401040
```puppet
10411041
apt::source { 'puppetlabs':
1042-
source_format => 'deb822'
1042+
source_format => 'sources'
10431043
uris => ['http://apt.puppetlabs.com'],
10441044
suites => [$facts['os']['distro']['codename']],
10451045
components => ['puppet8'],
@@ -1077,11 +1077,11 @@ The following parameters are available in the `apt::source` defined type:
10771077

10781078
##### <a name="-apt--source--source_format"></a>`source_format`
10791079

1080-
Data type: `Enum['legacy', 'deb822']`
1080+
Data type: `Enum['list', 'sources']`
10811081

10821082
The file format to use for the apt source. See https://wiki.debian.org/SourcesList
10831083

1084-
Default value: `'legacy'`
1084+
Default value: `'list'`
10851085

10861086
##### <a name="-apt--source--location"></a>`location`
10871087

manifests/source.pp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#
2424
# @example Install the puppetlabs apt source (deb822 format)
2525
# apt::source { 'puppetlabs':
26-
# source_format => 'deb822'
26+
# source_format => 'sources'
2727
# uris => ['http://apt.puppetlabs.com'],
2828
# suites => [$facts['os']['distro']['codename']],
2929
# components => ['puppet8'],
@@ -116,7 +116,7 @@
116116
# Specifies whether to check if the package release date is valid. Defaults to `True`.
117117
#
118118
define apt::source (
119-
Enum['legacy', 'deb822'] $source_format = 'legacy',
119+
Enum['list', 'sources'] $source_format = 'list',
120120
Array[Enum['deb','deb-src'], 1, 2] $types = ['deb'],
121121
Optional[String] $location = undef,
122122
Optional[Array[String]] $uris = undef, # deb822
@@ -145,8 +145,8 @@
145145
$_before = Apt::Setting["list-${title}"]
146146

147147
case $source_format {
148-
'legacy': {
149-
$_file_suffix = 'list'
148+
'list': {
149+
$_file_suffix = $source_format
150150

151151
if !$release {
152152
if fact('os.distro.codename') {
@@ -292,7 +292,7 @@
292292
create_resources('apt::pin', { "${name}" => $_pin })
293293
}
294294
}
295-
'deb822': {
295+
'sources': {
296296
if $pin {
297297
fail('apt::source::pin parameter is not supported with deb822 format')
298298
}
@@ -305,7 +305,7 @@
305305
if !$components {
306306
fail('You must specify a list of components for the apt::source resource')
307307
}
308-
$_file_suffix = 'sources'
308+
$_file_suffix = $source_format
309309
case $ensure {
310310
'present': {
311311
$header = epp('apt/_header.epp')

0 commit comments

Comments
 (0)