Skip to content

Commit

Permalink
Merge pull request #6 from bastelfreak/validate
Browse files Browse the repository at this point in the history
repo: parameters: default to undef
  • Loading branch information
bastelfreak committed Feb 27, 2024
2 parents b1af660 + 40bdf88 commit 3987294
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

define aptly::repo(
Array $architectures = [],
String $comment = '',
String $component = '',
String $distribution = '',
){
include ::aptly
Optional[String[1]] $comment = undef,
Optional[String[1]] $component = undef,
Optional[String[1]] $distribution = undef,
) {
include aptly

$aptly_cmd = "${::aptly::aptly_cmd} repo"

Expand All @@ -37,22 +37,22 @@
$architectures_arg = "-architectures=\"${architectures_as_s}\""
}

if empty($comment) {
$comment_arg = if $comment {
"-comment=\"${comment}\""
} else {
$comment_arg = ''
} else{
$comment_arg = "-comment=\"${comment}\""
}

if empty($component) {
$component_arg = ''
} else{
$component_arg = "-component=\"${component}\""
$component_arg = if $component {
"-component=\"${component}\""
} else {
''
}

if empty($distribution) {
$distribution_arg = ''
} else{
$distribution_arg = "-distribution=\"${distribution}\""
$distribution_arg = if $distribution {
"-distribution=\"${distribution}\""
} else {
''
}

exec{ "aptly_repo_create-${title}":
Expand Down

0 comments on commit 3987294

Please sign in to comment.