Skip to content

Commit b1e2167

Browse files
committed
Update puppet-strings and logic
Remove references to unused deb822 parameters Update parameter descriptions Update deb822 example Update warnings for $pin and $key usage with deb822. Currently unsupported Don't fail if $location is missing unless $ensure is 'present'
1 parent f862e3d commit b1e2167

File tree

2 files changed

+26
-70
lines changed

2 files changed

+26
-70
lines changed

REFERENCE.md

Lines changed: 11 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,10 +1040,9 @@ apt::source { 'puppetlabs':
10401040
```puppet
10411041
apt::source { 'puppetlabs':
10421042
source_format => 'sources'
1043-
uris => ['http://apt.puppetlabs.com'],
1044-
suites => [$facts['os']['distro']['codename']],
1045-
components => ['puppet8'],
1046-
signed_by => '/etc/apt/keyrings/puppetlabs.gpg',
1043+
location => ['http://apt.puppetlabs.com'],
1044+
repos => ['puppet8'],
1045+
keyring => '/etc/apt/keyrings/puppetlabs.gpg',
10471046
}
10481047
```
10491048

@@ -1054,23 +1053,17 @@ The following parameters are available in the `apt::source` defined type:
10541053
* [`source_format`](#-apt--source--source_format)
10551054
* [`location`](#-apt--source--location)
10561055
* [`types`](#-apt--source--types)
1057-
* [`uris`](#-apt--source--uris)
10581056
* [`enabled`](#-apt--source--enabled)
10591057
* [`comment`](#-apt--source--comment)
10601058
* [`ensure`](#-apt--source--ensure)
10611059
* [`release`](#-apt--source--release)
1062-
* [`suites`](#-apt--source--suites)
10631060
* [`repos`](#-apt--source--repos)
1064-
* [`components`](#-apt--source--components)
10651061
* [`include`](#-apt--source--include)
10661062
* [`key`](#-apt--source--key)
10671063
* [`keyring`](#-apt--source--keyring)
1068-
* [`signed_by`](#-apt--source--signed_by)
10691064
* [`pin`](#-apt--source--pin)
10701065
* [`architecture`](#-apt--source--architecture)
1071-
* [`architectures`](#-apt--source--architectures)
10721066
* [`allow_unsigned`](#-apt--source--allow_unsigned)
1073-
* [`repo_trusted`](#-apt--source--repo_trusted)
10741067
* [`allow_insecure`](#-apt--source--allow_insecure)
10751068
* [`notify_update`](#-apt--source--notify_update)
10761069
* [`check_valid_until`](#-apt--source--check_valid_until)
@@ -1085,9 +1078,10 @@ Default value: `'list'`
10851078

10861079
##### <a name="-apt--source--location"></a>`location`
10871080

1088-
Data type: `Optional[String]`
1081+
Data type: `Optional[Variant[String, Array[String]]]`
10891082

10901083
Required, unless ensure is set to 'absent'. Specifies an Apt repository. Valid options: a string containing a repository URL.
1084+
DEB822: Supports an array of URL values
10911085

10921086
Default value: `undef`
10931087

@@ -1099,14 +1093,6 @@ DEB822: The package types this source manages.
10991093

11001094
Default value: `['deb']`
11011095

1102-
##### <a name="-apt--source--uris"></a>`uris`
1103-
1104-
Data type: `Optional[Array[String]]`
1105-
1106-
DEB822: A list of URIs for the APT source.
1107-
1108-
Default value: `undef`
1109-
11101096
##### <a name="-apt--source--enabled"></a>`enabled`
11111097

11121098
Data type: `Boolean`
@@ -1133,36 +1119,22 @@ Default value: `present`
11331119

11341120
##### <a name="-apt--source--release"></a>`release`
11351121

1136-
Data type: `Optional[String]`
1122+
Data type: `Optional[Variant[String, Array[String]]]`
11371123

11381124
Specifies a distribution of the Apt repository.
1139-
1140-
Default value: `undef`
1141-
1142-
##### <a name="-apt--source--suites"></a>`suites`
1143-
1144-
Data type: `Optional[Array[String]]`
1145-
1146-
DEB822: A list of suites for the APT source ('jammy-updates', 'bookworm', 'stable', etc.).
1125+
DEB822: Supports an array of values
11471126

11481127
Default value: `undef`
11491128

11501129
##### <a name="-apt--source--repos"></a>`repos`
11511130

1152-
Data type: `String`
1131+
Data type: `Variant[String, Array[String]]`
11531132

11541133
Specifies a component of the Apt repository.
1134+
DEB822: Supports an array of values
11551135

11561136
Default value: `'main'`
11571137

1158-
##### <a name="-apt--source--components"></a>`components`
1159-
1160-
Data type: `Optional[Array[String]]`
1161-
1162-
DEB822: A list of components for the APT source ('main', 'contrib', 'non-free', etc.).
1163-
1164-
Default value: `undef`
1165-
11661138
##### <a name="-apt--source--include"></a>`include`
11671139

11681140
Data type: `Variant[Hash]`
@@ -1199,14 +1171,6 @@ See https://wiki.debian.org/DebianRepository/UseThirdParty for details.
11991171

12001172
Default value: `undef`
12011173

1202-
##### <a name="-apt--source--signed_by"></a>`signed_by`
1203-
1204-
Data type: `Optional[Variant[Stdlib::AbsolutePath,Array[String]]]`
1205-
1206-
DEB822: Either an absolute path to a PGP keyring file used to sign this repository OR a list of key fingerprints to trust.
1207-
1208-
Default value: `undef`
1209-
12101174
##### <a name="-apt--source--pin"></a>`pin`
12111175

12121176
Data type: `Optional[Variant[Hash, Numeric, String]]`
@@ -1218,19 +1182,12 @@ Default value: `undef`
12181182

12191183
##### <a name="-apt--source--architecture"></a>`architecture`
12201184

1221-
Data type: `Optional[String]`
1185+
Data type: `Optional[Variant[String, Array[String]]]`
12221186

12231187
Tells Apt to only download information for specified architectures. Valid options: a string containing one or more architecture names,
12241188
separated by commas (e.g., 'i386' or 'i386,alpha,powerpc').
12251189
(if unspecified, Apt downloads information for all architectures defined in the Apt::Architectures option)
1226-
1227-
Default value: `undef`
1228-
1229-
##### <a name="-apt--source--architectures"></a>`architectures`
1230-
1231-
Data type: `Optional[Array[String]]`
1232-
1233-
DEB822: A list of supported architectures for the APT source ('amd64', 'i386', etc.).
1190+
DEB822: Supports an array of values
12341191

12351192
Default value: `undef`
12361193

@@ -1242,14 +1199,6 @@ Specifies whether to authenticate packages from this release, even if the Releas
12421199

12431200
Default value: `undef`
12441201

1245-
##### <a name="-apt--source--repo_trusted"></a>`repo_trusted`
1246-
1247-
Data type: `Optional[Boolean]`
1248-
1249-
DEB822: Consider the APT source trusted, even if authentication checks fail.
1250-
1251-
Default value: `undef`
1252-
12531202
##### <a name="-apt--source--allow_insecure"></a>`allow_insecure`
12541203

12551204
Data type: `Optional[Boolean]`

manifests/source.pp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@
2424
# @example Install the puppetlabs apt source (deb822 format)
2525
# apt::source { 'puppetlabs':
2626
# source_format => 'sources'
27-
# uris => ['http://apt.puppetlabs.com'],
28-
# suites => [$facts['os']['distro']['codename']],
29-
# components => ['puppet8'],
30-
# signed_by => '/etc/apt/keyrings/puppetlabs.gpg',
27+
# location => ['http://apt.puppetlabs.com'],
28+
# repos => ['puppet8'],
29+
# keyring => '/etc/apt/keyrings/puppetlabs.gpg',
3130
# }
3231
#
3332
# @param source_format
3433
# The file format to use for the apt source. See https://wiki.debian.org/SourcesList
3534
#
3635
# @param location
3736
# Required, unless ensure is set to 'absent'. Specifies an Apt repository. Valid options: a string containing a repository URL.
37+
# DEB822: Supports an array of URL values
3838
#
3939
# @param types
4040
# DEB822: The package types this source manages.
@@ -50,9 +50,11 @@
5050
#
5151
# @param release
5252
# Specifies a distribution of the Apt repository.
53+
# DEB822: Supports an array of values
5354
#
5455
# @param repos
5556
# Specifies a component of the Apt repository.
57+
# DEB822: Supports an array of values
5658
#
5759
# @param include
5860
# Configures include options. Valid options: a hash of available keys.
@@ -84,6 +86,7 @@
8486
# Tells Apt to only download information for specified architectures. Valid options: a string containing one or more architecture names,
8587
# separated by commas (e.g., 'i386' or 'i386,alpha,powerpc').
8688
# (if unspecified, Apt downloads information for all architectures defined in the Apt::Architectures option)
89+
# DEB822: Supports an array of values
8790
#
8891
# @param allow_unsigned
8992
# Specifies whether to authenticate packages from this release, even if the Release file is not signed or the signature can't be checked.
@@ -272,11 +275,15 @@
272275
$_file_suffix = $source_format
273276

274277
if $pin {
275-
warning('apt::source::pin parameter is not supported with deb822 format.')
278+
warning("'pin' parameter is not supported with deb822 format.")
276279
}
277-
278-
if !$location {
279-
fail('You must specify a list of URIs for the apt::source resource')
280+
if $key {
281+
warning("'key' parameter is not supported with deb822 format.")
282+
}
283+
if $ensure == 'present' {
284+
if ! $location {
285+
fail('cannot create a source entry without specifying a location')
286+
}
280287
}
281288
if (type($location, 'generalized') !~ Type[Array]) {
282289
warning('For deb822 sources, location must be specified as an array.')

0 commit comments

Comments
 (0)