From b551cab0854cdb9478711341887570fd0eb22c6a Mon Sep 17 00:00:00 2001 From: Maurice Meyer Date: Thu, 15 Nov 2018 13:01:38 +0100 Subject: [PATCH] Enable arbitrary configuration. Fixes #67 --- manifests/config.pp | 11 ++++++++++- manifests/params.pp | 12 +----------- metadata.json | 2 +- templates/aptly.conf.erb | 4 +--- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index e81e65f..b7b2e21 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -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: diff --git a/manifests/params.pp b/manifests/params.pp index d2f73ad..2f4358e 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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 diff --git a/metadata.json b/metadata.json index 89d8147..931a0c2 100644 --- a/metadata.json +++ b/metadata.json @@ -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", diff --git a/templates/aptly.conf.erb b/templates/aptly.conf.erb index 5026c14..f9c8fd8 100644 --- a/templates/aptly.conf.erb +++ b/templates/aptly.conf.erb @@ -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 %>,