Skip to content

Commit

Permalink
Add support for Puppet 6
Browse files Browse the repository at this point in the history
Work around broken delete_undef_values() function which doesn't handle
undef values on Puppet 6 anymore (see https://github
.com/puppetlabs/puppetlabs-stdlib/pull/954).
  • Loading branch information
tohuwabohu committed Sep 23, 2018
1 parent 4dd3368 commit d225d23
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ matrix:
- name: "Puppet 5 Unit Tests"
rvm: 2.4
env: PUPPET_VERSION="~> 5"
- name: "Puppet 6 Unit Tests"
rvm: 2.5
env: PUPPET_VERSION="~> 6"
# Beaker tests
- name: "Debian 8 Acceptance Tests"
env: BEAKER_set=debian-8-64
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Parameter `duply_archive_checksum_type` which can be used to specify a different checksum type when using the archive
provider. The default is `sha1`.
provider. The default is `sha1`.
- Support for [Puppet 6](https://puppet.com/blog/introducing-puppet-6)

### Removed
- Parameter `duply_archive_package_dir` is no longer required as the downloaded duply archives are now deleted after
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ end
if (puppetversion = ENV['PUPPET_VERSION'])
gem 'puppet', puppetversion
else
gem 'puppet', '~> 5.0'
gem 'puppet', '~> 6.0'
end
9 changes: 5 additions & 4 deletions manifests/profile.pp
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@
true => [],
default => any2array($gpg_encryption_keys)
}
$real_gpg_signing_key = empty($gpg_signing_key) ? {
true => undef,
default => $gpg_signing_key
$real_gpg_signing_keys = empty($gpg_signing_key) ? {
true => [],
default => any2array($gpg_signing_key)
}
$real_gpg_options = empty($gpg_options) ? {
true => [],
Expand Down Expand Up @@ -245,7 +245,7 @@
default => absent,
}
$complete_encryption_keys = prefix($real_gpg_encryption_keys, "${title}/")
$complete_signing_keys = prefix(delete_undef_values([$real_gpg_signing_key]), "${title}/")
$complete_signing_keys = prefix($real_gpg_signing_keys, "${title}/")

file { $profile_config_dir:
ensure => $profile_config_dir_ensure,
Expand Down Expand Up @@ -384,6 +384,7 @@
$cron_command = $duply_command
}


cron { "backup-${title}":
ensure => $cron_ensure,
command => $cron_command,
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">=4.0.0 <6.0.0"
"version_requirement": ">= 4.0.0 < 7.0.0"
}
],
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/duply/conf.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%-
real_gpg_passphrase = (@gpg_passphrase and !@gpg_passphrase.empty?) ? @gpg_passphrase.gsub("'", %q('\\\'')) : ''
real_gpg_signing_key = (@real_gpg_signing_key and !@real_gpg_signing_key.empty?) ? @real_gpg_signing_key : 'disabled'
real_gpg_signing_key = (@real_gpg_signing_keys and !@real_gpg_signing_keys.empty?) ? @real_gpg_signing_keys.first : 'disabled'
-%>
# This file is managed by Puppet

Expand Down

0 comments on commit d225d23

Please sign in to comment.