Skip to content

Commit 545c99a

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 2fb1ed7 commit 545c99a

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
@@ -1093,10 +1093,9 @@ apt::source { 'puppetlabs':
10931093
```puppet
10941094
apt::source { 'puppetlabs':
10951095
source_format => 'sources'
1096-
uris => ['http://apt.puppetlabs.com'],
1097-
suites => [$facts['os']['distro']['codename']],
1098-
components => ['puppet8'],
1099-
signed_by => '/etc/apt/keyrings/puppetlabs.gpg',
1096+
location => ['http://apt.puppetlabs.com'],
1097+
repos => ['puppet8'],
1098+
keyring => '/etc/apt/keyrings/puppetlabs.gpg',
11001099
}
11011100
```
11021101

@@ -1107,23 +1106,17 @@ The following parameters are available in the `apt::source` defined type:
11071106
* [`source_format`](#-apt--source--source_format)
11081107
* [`location`](#-apt--source--location)
11091108
* [`types`](#-apt--source--types)
1110-
* [`uris`](#-apt--source--uris)
11111109
* [`enabled`](#-apt--source--enabled)
11121110
* [`comment`](#-apt--source--comment)
11131111
* [`ensure`](#-apt--source--ensure)
11141112
* [`release`](#-apt--source--release)
1115-
* [`suites`](#-apt--source--suites)
11161113
* [`repos`](#-apt--source--repos)
1117-
* [`components`](#-apt--source--components)
11181114
* [`include`](#-apt--source--include)
11191115
* [`key`](#-apt--source--key)
11201116
* [`keyring`](#-apt--source--keyring)
1121-
* [`signed_by`](#-apt--source--signed_by)
11221117
* [`pin`](#-apt--source--pin)
11231118
* [`architecture`](#-apt--source--architecture)
1124-
* [`architectures`](#-apt--source--architectures)
11251119
* [`allow_unsigned`](#-apt--source--allow_unsigned)
1126-
* [`repo_trusted`](#-apt--source--repo_trusted)
11271120
* [`allow_insecure`](#-apt--source--allow_insecure)
11281121
* [`notify_update`](#-apt--source--notify_update)
11291122
* [`check_valid_until`](#-apt--source--check_valid_until)
@@ -1138,9 +1131,10 @@ Default value: `'list'`
11381131

11391132
##### <a name="-apt--source--location"></a>`location`
11401133

1141-
Data type: `Optional[String]`
1134+
Data type: `Optional[Variant[String, Array[String]]]`
11421135

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

11451139
Default value: `undef`
11461140

@@ -1152,14 +1146,6 @@ DEB822: The package types this source manages.
11521146

11531147
Default value: `['deb']`
11541148

1155-
##### <a name="-apt--source--uris"></a>`uris`
1156-
1157-
Data type: `Optional[Array[String]]`
1158-
1159-
DEB822: A list of URIs for the APT source.
1160-
1161-
Default value: `undef`
1162-
11631149
##### <a name="-apt--source--enabled"></a>`enabled`
11641150

11651151
Data type: `Boolean`
@@ -1186,36 +1172,22 @@ Default value: `present`
11861172

11871173
##### <a name="-apt--source--release"></a>`release`
11881174

1189-
Data type: `Optional[String]`
1175+
Data type: `Optional[Variant[String, Array[String]]]`
11901176

11911177
Specifies a distribution of the Apt repository.
1192-
1193-
Default value: `undef`
1194-
1195-
##### <a name="-apt--source--suites"></a>`suites`
1196-
1197-
Data type: `Optional[Array[String]]`
1198-
1199-
DEB822: A list of suites for the APT source ('jammy-updates', 'bookworm', 'stable', etc.).
1178+
DEB822: Supports an array of values
12001179

12011180
Default value: `undef`
12021181

12031182
##### <a name="-apt--source--repos"></a>`repos`
12041183

1205-
Data type: `String`
1184+
Data type: `Variant[String, Array[String]]`
12061185

12071186
Specifies a component of the Apt repository.
1187+
DEB822: Supports an array of values
12081188

12091189
Default value: `'main'`
12101190

1211-
##### <a name="-apt--source--components"></a>`components`
1212-
1213-
Data type: `Optional[Array[String]]`
1214-
1215-
DEB822: A list of components for the APT source ('main', 'contrib', 'non-free', etc.).
1216-
1217-
Default value: `undef`
1218-
12191191
##### <a name="-apt--source--include"></a>`include`
12201192

12211193
Data type: `Variant[Hash]`
@@ -1252,14 +1224,6 @@ See https://wiki.debian.org/DebianRepository/UseThirdParty for details.
12521224

12531225
Default value: `undef`
12541226

1255-
##### <a name="-apt--source--signed_by"></a>`signed_by`
1256-
1257-
Data type: `Optional[Variant[Stdlib::AbsolutePath,Array[String]]]`
1258-
1259-
DEB822: Either an absolute path to a PGP keyring file used to sign this repository OR a list of key fingerprints to trust.
1260-
1261-
Default value: `undef`
1262-
12631227
##### <a name="-apt--source--pin"></a>`pin`
12641228

12651229
Data type: `Optional[Variant[Hash, Numeric, String]]`
@@ -1271,19 +1235,12 @@ Default value: `undef`
12711235

12721236
##### <a name="-apt--source--architecture"></a>`architecture`
12731237

1274-
Data type: `Optional[String]`
1238+
Data type: `Optional[Variant[String, Array[String]]]`
12751239

12761240
Tells Apt to only download information for specified architectures. Valid options: a string containing one or more architecture names,
12771241
separated by commas (e.g., 'i386' or 'i386,alpha,powerpc').
12781242
(if unspecified, Apt downloads information for all architectures defined in the Apt::Architectures option)
1279-
1280-
Default value: `undef`
1281-
1282-
##### <a name="-apt--source--architectures"></a>`architectures`
1283-
1284-
Data type: `Optional[Array[String]]`
1285-
1286-
DEB822: A list of supported architectures for the APT source ('amd64', 'i386', etc.).
1243+
DEB822: Supports an array of values
12871244

12881245
Default value: `undef`
12891246

@@ -1295,14 +1252,6 @@ Specifies whether to authenticate packages from this release, even if the Releas
12951252

12961253
Default value: `undef`
12971254

1298-
##### <a name="-apt--source--repo_trusted"></a>`repo_trusted`
1299-
1300-
Data type: `Optional[Boolean]`
1301-
1302-
DEB822: Consider the APT source trusted, even if authentication checks fail.
1303-
1304-
Default value: `undef`
1305-
13061255
##### <a name="-apt--source--allow_insecure"></a>`allow_insecure`
13071256

13081257
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.
@@ -275,11 +278,15 @@
275278
$_file_suffix = $source_format
276279

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

0 commit comments

Comments
 (0)