Skip to content

Commit 44c0a7c

Browse files
committed
Add puppet strings documentation
1 parent c74f6f6 commit 44c0a7c

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
@@ -26,6 +26,7 @@
2626
* [`apt::ppa`](#apt--ppa): Manages PPA repositories using `add-apt-repository`. Not supported on Debian.
2727
* [`apt::setting`](#apt--setting): Manages Apt configuration files.
2828
* [`apt::source`](#apt--source): Manages the Apt sources in /etc/apt/sources.list.d/.
29+
* [`apt::source_deb822`](#apt--source_deb822): Manage deb822 formatted APT sources under `/etc/apt/sources.list.d`
2930

3031
### Resource types
3132

@@ -1181,6 +1182,156 @@ Specifies whether to check if the package release date is valid. Defaults to `Tr
11811182

11821183
Default value: `true`
11831184

1185+
### <a name="apt--source_deb822"></a>`apt::source_deb822`
1186+
1187+
Manage deb822 formatted APT sources under `/etc/apt/sources.list.d`
1188+
1189+
#### Examples
1190+
1191+
##### Manage the Puppetlabs repo
1192+
1193+
```puppet
1194+
apt::source_deb822 { 'Puppetlabs-puppet':
1195+
comment => 'Manage the puppetlabs repo',
1196+
enabled => true,
1197+
types => ['deb'],
1198+
uris => ['http://apt.puppet.com'],
1199+
suites => ['jammy'],
1200+
components => ['puppet8'],
1201+
signed_by => ['/etc/apt/keyrings/linuxembl-ebi.gpg'],
1202+
}
1203+
```
1204+
1205+
##### Ensure absence of a repo
1206+
1207+
```puppet
1208+
apt::source_deb822 { 'testing123':
1209+
ensure => 'absent',
1210+
}
1211+
```
1212+
1213+
#### Parameters
1214+
1215+
The following parameters are available in the `apt::source_deb822` defined type:
1216+
1217+
* [`notify_update`](#-apt--source_deb822--notify_update)
1218+
* [`ensure`](#-apt--source_deb822--ensure)
1219+
* [`enabled`](#-apt--source_deb822--enabled)
1220+
* [`comment`](#-apt--source_deb822--comment)
1221+
* [`types`](#-apt--source_deb822--types)
1222+
* [`uris`](#-apt--source_deb822--uris)
1223+
* [`suites`](#-apt--source_deb822--suites)
1224+
* [`components`](#-apt--source_deb822--components)
1225+
* [`architectures`](#-apt--source_deb822--architectures)
1226+
* [`allow_insecure`](#-apt--source_deb822--allow_insecure)
1227+
* [`repo_trusted`](#-apt--source_deb822--repo_trusted)
1228+
* [`check_valid_until`](#-apt--source_deb822--check_valid_until)
1229+
* [`signed_by`](#-apt--source_deb822--signed_by)
1230+
1231+
##### <a name="-apt--source_deb822--notify_update"></a>`notify_update`
1232+
1233+
Data type: `Boolean`
1234+
1235+
Specifies whether to trigger an `apt-get update` run.
1236+
1237+
Default value: `true`
1238+
1239+
##### <a name="-apt--source_deb822--ensure"></a>`ensure`
1240+
1241+
Data type: `Enum['present','absent']`
1242+
1243+
Specifies whether the Apt source file should exist.
1244+
1245+
Default value: `'present'`
1246+
1247+
##### <a name="-apt--source_deb822--enabled"></a>`enabled`
1248+
1249+
Data type: `Boolean`
1250+
1251+
Enable or Disable the APT source.
1252+
1253+
Default value: `true`
1254+
1255+
##### <a name="-apt--source_deb822--comment"></a>`comment`
1256+
1257+
Data type: `String`
1258+
1259+
Provide a comment to the APT source file.
1260+
1261+
Default value: `$name`
1262+
1263+
##### <a name="-apt--source_deb822--types"></a>`types`
1264+
1265+
Data type: `Array[Enum['deb','deb-src'], 1, 2]`
1266+
1267+
The package types this source manages.
1268+
1269+
Default value: `['deb']`
1270+
1271+
##### <a name="-apt--source_deb822--uris"></a>`uris`
1272+
1273+
Data type: `Optional[Array[String]]`
1274+
1275+
A list of URIs for the APT source.
1276+
1277+
Default value: `undef`
1278+
1279+
##### <a name="-apt--source_deb822--suites"></a>`suites`
1280+
1281+
Data type: `Optional[Array[String]]`
1282+
1283+
A list of suites for the APT source ('jammy-updates', 'bookworm', 'stable', etc.).
1284+
1285+
Default value: `undef`
1286+
1287+
##### <a name="-apt--source_deb822--components"></a>`components`
1288+
1289+
Data type: `Optional[Array[String]]`
1290+
1291+
A list of components for the APT source ('main', 'contrib', 'non-free', etc.).
1292+
1293+
Default value: `undef`
1294+
1295+
##### <a name="-apt--source_deb822--architectures"></a>`architectures`
1296+
1297+
Data type: `Optional[Array[String]]`
1298+
1299+
A list of supported architectures for the APT source ('amd64', 'i386', etc.).
1300+
1301+
Default value: `undef`
1302+
1303+
##### <a name="-apt--source_deb822--allow_insecure"></a>`allow_insecure`
1304+
1305+
Data type: `Optional[Boolean]`
1306+
1307+
Specifies whether to allow downloads from insecure repositories.
1308+
1309+
Default value: `undef`
1310+
1311+
##### <a name="-apt--source_deb822--repo_trusted"></a>`repo_trusted`
1312+
1313+
Data type: `Optional[Boolean]`
1314+
1315+
Consider the APT source trusted, even if authentication checks fail.
1316+
1317+
Default value: `undef`
1318+
1319+
##### <a name="-apt--source_deb822--check_valid_until"></a>`check_valid_until`
1320+
1321+
Data type: `Optional[Boolean]`
1322+
1323+
Specifies whether to check if the package release date is valid.
1324+
1325+
Default value: `undef`
1326+
1327+
##### <a name="-apt--source_deb822--signed_by"></a>`signed_by`
1328+
1329+
Data type: `Optional[Variant[Array[Stdlib::AbsolutePath],String]]`
1330+
1331+
Absolute path to a file containing the PGP keyring used to sign this repository.
1332+
1333+
Default value: `undef`
1334+
11841335
## Data types
11851336

11861337
### <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)