Skip to content

Commit

Permalink
Enable arbitrary configuration. Fixes tubemogul#67
Browse files Browse the repository at this point in the history
  • Loading branch information
Maurice Meyer committed Nov 15, 2018
1 parent 18b1acd commit b551cab
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
11 changes: 10 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,18 @@
group => $aptly::group,
}

$config = {
'rootDir' => $aptly::root_dir,
'architectures' => $aptly::architectures,
'ppaDistributorID' => $aptly::ppa_dist,
'ppaCodename' => $aptly::ppa_codename,
'S3PublishEndpoints' => $aptly::s3_publish_endpoints,
'SwiftPublishEndpoints' => $aptly::swift_publish_endpoints,
} + $aptly::properties

file { $aptly::config_filepath:
ensure => file,
content => template('aptly/aptly.conf.erb'),
content => to_json_pretty($config),
}

file { $aptly::root_dir:
Expand Down
12 changes: 1 addition & 11 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,7 @@
$architectures = [$::architecture]
$ppa_dist = 'ubuntu'
$ppa_codename = ''
$properties = {
'downloadConcurrency' => 4,
'downloadSpeedLimit' => 0,
'dependencyFollowSuggests' => false,
'dependencyFollowRecommends' => false,
'dependencyFollowAllVariants' => false,
'dependencyFollowSource' => false,
'gpgDisableSign' => false,
'gpgDisableVerify' => false,
'downloadSourcePackages' => false,
}
$properties = {}
$s3_publish_endpoints = {}
$swift_publish_endpoints = {}
$enable_api = false
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.0.0 < 5.0.0"
"version_requirement": ">= 4.24.0 < 5.0.0"
},
{
"name": "puppetlabs/apt",
Expand Down
4 changes: 1 addition & 3 deletions templates/aptly.conf.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"rootDir": "<%= scope.lookupvar('aptly::root_dir') -%>",
"architectures": ["<%= scope.lookupvar('aptly::architectures').join('", "') %>"],
<% scope.lookupvar('aptly::properties').each do |k, v| -%>
"<%= k -%>": <%= v %>,
<% end -%>
<%= scope.lookupvar('aptly::properties').to_pson -%>,
"ppaDistributorID": "<%= scope.lookupvar('aptly::ppa_dist') %>",
"ppaCodename": "<%= scope.lookupvar('aptly::ppa_codename') %>",
"S3PublishEndpoints": <%= scope.lookupvar('aptly::s3_publish_endpoints').to_pson %>,
Expand Down

0 comments on commit b551cab

Please sign in to comment.