Skip to content

Commit

Permalink
(CAT-1483) - Enhancement of validation for apt::source parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramesh7 committed Sep 27, 2023
1 parent 0a23900 commit f90dbd8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
18 changes: 9 additions & 9 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -946,41 +946,41 @@ The following parameters are available in the `apt::source` defined type:

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

Data type: `Optional[String]`
Data type: `Optional[String[1]]`

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

Default value: `undef`

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

Data type: `String`
Data type: `String[1]`

Supplies a comment for adding to the Apt source file.

Default value: `$name`

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

Data type: `String`
Data type: `String[1]`

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

Default value: `present`

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

Data type: `Optional[String]`
Data type: `Optional[String[1]]`

Specifies a distribution of the Apt repository.

Default value: `undef`

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

Data type: `String`
Data type: `String[1]`

Specifies a component of the Apt repository.
Specifies a component of the Apt repository. Default 'main'.

Default value: `'main'`

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

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

Data type: `Optional[Variant[String, Hash]]`
Data type: `Optional[Variant[String[1], Hash]]`

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

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

Data type: `Optional[Variant[Hash, Numeric, String]]`
Data type: `Optional[Variant[Hash, Numeric, String[1]]]`

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

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

Data type: `Optional[String]`
Data type: `Optional[String[1]]`

Tells Apt to only download information for specified architectures. Valid options: a string containing one or more architecture names,
separated by commas (e.g., 'i386' or 'i386,alpha,powerpc'). Default: undef (if unspecified, Apt downloads information for all architectures
Expand Down
30 changes: 15 additions & 15 deletions manifests/source.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Specifies a distribution of the Apt repository.
#
# @param repos
# Specifies a component of the Apt repository.
# Specifies a component of the Apt repository. Default 'main'.
#
# @param include
# Configures include options. Valid options: a hash of available keys.
Expand Down Expand Up @@ -65,20 +65,20 @@
# Specifies whether to check if the package release date is valid. Defaults to `True`.
#
define apt::source (
Optional[String] $location = undef,
String $comment = $name,
String $ensure = present,
Optional[String] $release = undef,
String $repos = 'main',
Variant[Hash] $include = {},
Optional[Variant[String, Hash]] $key = undef,
Optional[Stdlib::AbsolutePath] $keyring = undef,
Optional[Variant[Hash, Numeric, String]] $pin = undef,
Optional[String] $architecture = undef,
Boolean $allow_unsigned = false,
Boolean $allow_insecure = false,
Boolean $notify_update = true,
Boolean $check_valid_until = true,
Optional[String[1]] $location = undef,
String[1] $comment = $name,
String[1] $ensure = present,
Optional[String[1]] $release = undef,
String[1] $repos = 'main',
Variant[Hash] $include = {},
Optional[Variant[String[1], Hash]] $key = undef,
Optional[Stdlib::AbsolutePath] $keyring = undef,
Optional[Variant[Hash, Numeric, String[1]]] $pin = undef,
Optional[String[1]] $architecture = undef,
Boolean $allow_unsigned = false,
Boolean $allow_insecure = false,
Boolean $notify_update = true,
Boolean $check_valid_until = true,
) {
include apt

Expand Down

0 comments on commit f90dbd8

Please sign in to comment.