Skip to content

Commit f90dbd8

Browse files
committed
(CAT-1483) - Enhancement of validation for apt::source parameters
1 parent 0a23900 commit f90dbd8

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

REFERENCE.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -946,41 +946,41 @@ The following parameters are available in the `apt::source` defined type:
946946

947947
##### <a name="-apt--source--location"></a>`location`
948948

949-
Data type: `Optional[String]`
949+
Data type: `Optional[String[1]]`
950950

951951
Required, unless ensure is set to 'absent'. Specifies an Apt repository. Valid options: a string containing a repository URL.
952952

953953
Default value: `undef`
954954

955955
##### <a name="-apt--source--comment"></a>`comment`
956956

957-
Data type: `String`
957+
Data type: `String[1]`
958958

959959
Supplies a comment for adding to the Apt source file.
960960

961961
Default value: `$name`
962962

963963
##### <a name="-apt--source--ensure"></a>`ensure`
964964

965-
Data type: `String`
965+
Data type: `String[1]`
966966

967967
Specifies whether the Apt source file should exist. Valid options: 'present' and 'absent'.
968968

969969
Default value: `present`
970970

971971
##### <a name="-apt--source--release"></a>`release`
972972

973-
Data type: `Optional[String]`
973+
Data type: `Optional[String[1]]`
974974

975975
Specifies a distribution of the Apt repository.
976976

977977
Default value: `undef`
978978

979979
##### <a name="-apt--source--repos"></a>`repos`
980980

981-
Data type: `String`
981+
Data type: `String[1]`
982982

983-
Specifies a component of the Apt repository.
983+
Specifies a component of the Apt repository. Default 'main'.
984984

985985
Default value: `'main'`
986986

@@ -999,7 +999,7 @@ Default value: `{}`
999999

10001000
##### <a name="-apt--source--key"></a>`key`
10011001

1002-
Data type: `Optional[Variant[String, Hash]]`
1002+
Data type: `Optional[Variant[String[1], Hash]]`
10031003

10041004
Creates a declaration of the apt::key defined type. Valid options: a string to be passed to the `id` parameter of the `apt::key`
10051005
defined type, or a hash of `parameter => value` pairs to be passed to `apt::key`'s `id`, `server`, `content`, `source`, `weak_ssl`,
@@ -1018,7 +1018,7 @@ Default value: `undef`
10181018

10191019
##### <a name="-apt--source--pin"></a>`pin`
10201020

1021-
Data type: `Optional[Variant[Hash, Numeric, String]]`
1021+
Data type: `Optional[Variant[Hash, Numeric, String[1]]]`
10221022

10231023
Creates a declaration of the apt::pin defined type. Valid options: a number or string to be passed to the `id` parameter of the
10241024
`apt::pin` defined type, or a hash of `parameter => value` pairs to be passed to `apt::pin`'s corresponding parameters.
@@ -1027,7 +1027,7 @@ Default value: `undef`
10271027

10281028
##### <a name="-apt--source--architecture"></a>`architecture`
10291029

1030-
Data type: `Optional[String]`
1030+
Data type: `Optional[String[1]]`
10311031

10321032
Tells Apt to only download information for specified architectures. Valid options: a string containing one or more architecture names,
10331033
separated by commas (e.g., 'i386' or 'i386,alpha,powerpc'). Default: undef (if unspecified, Apt downloads information for all architectures

manifests/source.pp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# Specifies a distribution of the Apt repository.
2424
#
2525
# @param repos
26-
# Specifies a component of the Apt repository.
26+
# Specifies a component of the Apt repository. Default 'main'.
2727
#
2828
# @param include
2929
# Configures include options. Valid options: a hash of available keys.
@@ -65,20 +65,20 @@
6565
# Specifies whether to check if the package release date is valid. Defaults to `True`.
6666
#
6767
define apt::source (
68-
Optional[String] $location = undef,
69-
String $comment = $name,
70-
String $ensure = present,
71-
Optional[String] $release = undef,
72-
String $repos = 'main',
73-
Variant[Hash] $include = {},
74-
Optional[Variant[String, Hash]] $key = undef,
75-
Optional[Stdlib::AbsolutePath] $keyring = undef,
76-
Optional[Variant[Hash, Numeric, String]] $pin = undef,
77-
Optional[String] $architecture = undef,
78-
Boolean $allow_unsigned = false,
79-
Boolean $allow_insecure = false,
80-
Boolean $notify_update = true,
81-
Boolean $check_valid_until = true,
68+
Optional[String[1]] $location = undef,
69+
String[1] $comment = $name,
70+
String[1] $ensure = present,
71+
Optional[String[1]] $release = undef,
72+
String[1] $repos = 'main',
73+
Variant[Hash] $include = {},
74+
Optional[Variant[String[1], Hash]] $key = undef,
75+
Optional[Stdlib::AbsolutePath] $keyring = undef,
76+
Optional[Variant[Hash, Numeric, String[1]]] $pin = undef,
77+
Optional[String[1]] $architecture = undef,
78+
Boolean $allow_unsigned = false,
79+
Boolean $allow_insecure = false,
80+
Boolean $notify_update = true,
81+
Boolean $check_valid_until = true,
8282
) {
8383
include apt
8484

0 commit comments

Comments
 (0)