Skip to content

Commit 3698e1e

Browse files
committed
Add puppet strings documentation
1 parent 73023c9 commit 3698e1e

File tree

3 files changed

+213
-9
lines changed

3 files changed

+213
-9
lines changed

REFERENCE.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* [`apt::ppa`](#apt--ppa): Manages PPA repositories using `add-apt-repository`. Not supported on Debian.
2626
* [`apt::setting`](#apt--setting): Manages Apt configuration files.
2727
* [`apt::source`](#apt--source): Manages the Apt sources in /etc/apt/sources.list.d/.
28+
* [`apt::source_deb822`](#apt--source_deb822): Manage deb822 formatted APT sources under `/etc/apt/sources.list.d`
2829

2930
### Resource types
3031

@@ -1234,6 +1235,156 @@ Specifies whether to check if the package release date is valid.
12341235

12351236
Default value: `true`
12361237

1238+
### <a name="apt--source_deb822"></a>`apt::source_deb822`
1239+
1240+
Manage deb822 formatted APT sources under `/etc/apt/sources.list.d`
1241+
1242+
#### Examples
1243+
1244+
##### Manage the Puppetlabs repo
1245+
1246+
```puppet
1247+
apt::source_deb822 { 'Puppetlabs-puppet':
1248+
comment => 'Manage the puppetlabs repo',
1249+
enabled => true,
1250+
types => ['deb'],
1251+
uris => ['http://apt.puppet.com'],
1252+
suites => ['jammy'],
1253+
components => ['puppet8'],
1254+
signed_by => ['/etc/apt/keyrings/linuxembl-ebi.gpg'],
1255+
}
1256+
```
1257+
1258+
##### Ensure absence of a repo
1259+
1260+
```puppet
1261+
apt::source_deb822 { 'testing123':
1262+
ensure => 'absent',
1263+
}
1264+
```
1265+
1266+
#### Parameters
1267+
1268+
The following parameters are available in the `apt::source_deb822` defined type:
1269+
1270+
* [`notify_update`](#-apt--source_deb822--notify_update)
1271+
* [`ensure`](#-apt--source_deb822--ensure)
1272+
* [`enabled`](#-apt--source_deb822--enabled)
1273+
* [`comment`](#-apt--source_deb822--comment)
1274+
* [`types`](#-apt--source_deb822--types)
1275+
* [`uris`](#-apt--source_deb822--uris)
1276+
* [`suites`](#-apt--source_deb822--suites)
1277+
* [`components`](#-apt--source_deb822--components)
1278+
* [`architectures`](#-apt--source_deb822--architectures)
1279+
* [`allow_insecure`](#-apt--source_deb822--allow_insecure)
1280+
* [`repo_trusted`](#-apt--source_deb822--repo_trusted)
1281+
* [`check_valid_until`](#-apt--source_deb822--check_valid_until)
1282+
* [`signed_by`](#-apt--source_deb822--signed_by)
1283+
1284+
##### <a name="-apt--source_deb822--notify_update"></a>`notify_update`
1285+
1286+
Data type: `Boolean`
1287+
1288+
Specifies whether to trigger an `apt-get update` run.
1289+
1290+
Default value: `true`
1291+
1292+
##### <a name="-apt--source_deb822--ensure"></a>`ensure`
1293+
1294+
Data type: `Enum['present','absent']`
1295+
1296+
Specifies whether the Apt source file should exist.
1297+
1298+
Default value: `'present'`
1299+
1300+
##### <a name="-apt--source_deb822--enabled"></a>`enabled`
1301+
1302+
Data type: `Boolean`
1303+
1304+
Enable or Disable the APT source.
1305+
1306+
Default value: `true`
1307+
1308+
##### <a name="-apt--source_deb822--comment"></a>`comment`
1309+
1310+
Data type: `String`
1311+
1312+
Provide a comment to the APT source file.
1313+
1314+
Default value: `$name`
1315+
1316+
##### <a name="-apt--source_deb822--types"></a>`types`
1317+
1318+
Data type: `Array[Enum['deb','deb-src'], 1, 2]`
1319+
1320+
The package types this source manages.
1321+
1322+
Default value: `['deb']`
1323+
1324+
##### <a name="-apt--source_deb822--uris"></a>`uris`
1325+
1326+
Data type: `Optional[Array[String]]`
1327+
1328+
A list of URIs for the APT source.
1329+
1330+
Default value: `undef`
1331+
1332+
##### <a name="-apt--source_deb822--suites"></a>`suites`
1333+
1334+
Data type: `Optional[Array[String]]`
1335+
1336+
A list of suites for the APT source ('jammy-updates', 'bookworm', 'stable', etc.).
1337+
1338+
Default value: `undef`
1339+
1340+
##### <a name="-apt--source_deb822--components"></a>`components`
1341+
1342+
Data type: `Optional[Array[String]]`
1343+
1344+
A list of components for the APT source ('main', 'contrib', 'non-free', etc.).
1345+
1346+
Default value: `undef`
1347+
1348+
##### <a name="-apt--source_deb822--architectures"></a>`architectures`
1349+
1350+
Data type: `Optional[Array[String]]`
1351+
1352+
A list of supported architectures for the APT source ('amd64', 'i386', etc.).
1353+
1354+
Default value: `undef`
1355+
1356+
##### <a name="-apt--source_deb822--allow_insecure"></a>`allow_insecure`
1357+
1358+
Data type: `Optional[Boolean]`
1359+
1360+
Specifies whether to allow downloads from insecure repositories.
1361+
1362+
Default value: `undef`
1363+
1364+
##### <a name="-apt--source_deb822--repo_trusted"></a>`repo_trusted`
1365+
1366+
Data type: `Optional[Boolean]`
1367+
1368+
Consider the APT source trusted, even if authentication checks fail.
1369+
1370+
Default value: `undef`
1371+
1372+
##### <a name="-apt--source_deb822--check_valid_until"></a>`check_valid_until`
1373+
1374+
Data type: `Optional[Boolean]`
1375+
1376+
Specifies whether to check if the package release date is valid.
1377+
1378+
Default value: `undef`
1379+
1380+
##### <a name="-apt--source_deb822--signed_by"></a>`signed_by`
1381+
1382+
Data type: `Optional[Variant[Array[Stdlib::AbsolutePath],String]]`
1383+
1384+
Absolute path to a file containing the PGP keyring used to sign this repository.
1385+
1386+
Default value: `undef`
1387+
12371388
## Data types
12381389

12391390
### <a name="Apt--Auth_conf_entry"></a>`Apt::Auth_conf_entry`

manifests/source_deb822.pp

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,74 @@
1-
# @summary A short summary of the purpose of this defined type.
1+
# @summary Manage deb822 formatted APT sources under `/etc/apt/sources.list.d`
22
#
3-
# A description of what this defined type does
3+
# @example Manage the Puppetlabs repo
4+
# apt::source_deb822 { 'Puppetlabs-puppet':
5+
# comment => 'Manage the puppetlabs repo',
6+
# enabled => true,
7+
# types => ['deb'],
8+
# uris => ['http://apt.puppet.com'],
9+
# suites => ['jammy'],
10+
# components => ['puppet8'],
11+
# signed_by => ['/etc/apt/keyrings/linuxembl-ebi.gpg'],
12+
# }
13+
#
14+
# @example Ensure absence of a repo
15+
# apt::source_deb822 { 'testing123':
16+
# ensure => 'absent',
17+
# }
18+
#
19+
# @param notify_update
20+
# Specifies whether to trigger an `apt-get update` run.
21+
#
22+
# @param ensure
23+
# Specifies whether the Apt source file should exist.
24+
#
25+
# @param enabled
26+
# Enable or Disable the APT source.
27+
#
28+
# @param comment
29+
# Provide a comment to the APT source file.
30+
#
31+
# @param types
32+
# The package types this source manages.
33+
#
34+
# @param uris
35+
# A list of URIs for the APT source.
36+
#
37+
# @param suites
38+
# A list of suites for the APT source ('jammy-updates', 'bookworm', 'stable', etc.).
39+
#
40+
# @param components
41+
# A list of components for the APT source ('main', 'contrib', 'non-free', etc.).
42+
#
43+
# @param architectures
44+
# A list of supported architectures for the APT source ('amd64', 'i386', etc.).
45+
#
46+
# @param allow_insecure
47+
# Specifies whether to allow downloads from insecure repositories.
48+
#
49+
# @param repo_trusted
50+
# Consider the APT source trusted, even if authentication checks fail.
51+
#
52+
# @param check_valid_until
53+
# Specifies whether to check if the package release date is valid.
54+
#
55+
# @param signed_by
56+
# Absolute path to a file containing the PGP keyring used to sign this repository.
457
#
5-
# @example
6-
# apt::source_deb822 { 'namevar': }
758
define apt::source_deb822 (
8-
String $comment = $name,
59+
Enum['present','absent'] $ensure = 'present',
60+
Boolean $notify_update = true,
961
Boolean $enabled = true,
62+
String $comment = $name,
1063
Array[Enum['deb','deb-src'], 1, 2] $types = ['deb'],
11-
Boolean $notify_update = true,
12-
Enum['present','absent'] $ensure = 'present',
1364
Optional[Array[String]] $uris = undef,
1465
Optional[Array[String]] $suites = undef,
1566
Optional[Array[String]] $components = undef,
1667
Optional[Array[String]] $architectures = undef,
1768
Optional[Boolean] $allow_insecure = undef,
1869
Optional[Boolean] $repo_trusted = undef,
19-
Optional[Variant[Array[Stdlib::AbsolutePath],String]] $signed_by = undef,
2070
Optional[Boolean] $check_valid_until = undef,
71+
Optional[Variant[Array[Stdlib::AbsolutePath],String]] $signed_by = undef,
2172
) {
2273
case $ensure {
2374
'present': {
@@ -42,6 +93,9 @@
4293
$header = undef
4394
$source_content = undef
4495
}
96+
default: {
97+
fail('Unexpected value for $ensure parameter.')
98+
}
4599
}
46100

47101
apt::setting { "source-${name}":

templates/source_deb822.epp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
Optional[Enum['yes','no']] $repo_trusted = undef,
1010
Optional[Enum['yes','no']] $check_valid_until = undef,
1111
Optional[Variant[Array[String], String]] $signed_by = undef,
12-
Optional[Hash] $options = undef
1312
| -%>
1413
# <%= $comment %>
1514
Enabled: <%= $enabled %>

0 commit comments

Comments
 (0)