Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Distinguish different distributions for paramiko dependency #60

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
String $duply_package_ensure = $duplicity::params::duply_package_ensure,
String $duply_package_name = $duplicity::params::duply_package_name,
String $duply_package_provider = $duplicity::params::duply_package_provider,
String $duply_paramiko_package_name = $duplicity::params::duply_paramiko_package_name,
Array[String] $duply_extra_packages = $duplicity::params::duply_extra_packages,
String $duply_archive_version = $duplicity::params::duply_archive_version,
String $duply_archive_checksum = $duplicity::params::duply_archive_checksum,
Expand Down
8 changes: 4 additions & 4 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@
ensure => $duplicity::duply_package_ensure,
name => $duplicity::duply_package_name,
provider => $duplicity::duply_package_provider,
require => Package['python-paramiko'],
require => Package[$duplicity::duply_paramiko_package_name],
}
# Note (arnaudmorin): we cannot ensure pyton-paramiko $duplicity::duply_package_ensure as
# it can break if the package is already ensure present somewhere else in another module.
ensure_packages ( ['python-paramiko'], {
ensure => present,
ensure_packages([$duplicity::duply_paramiko_package_name], {
ensure => present,
})

# If duply was previously installed from archive, it should not pollute the PATH any more ...
Expand All @@ -72,5 +72,5 @@
}

# Install any additional packages that may be needed by the different backends
ensure_packages($duplicity::duply_extra_packages, {'ensure' => 'present'})
ensure_packages($duplicity::duply_extra_packages, { 'ensure' => 'present' })
}
21 changes: 21 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@
'Debian' => 'apt',
default => 'archive'
}

if $facts['os']['name'] == 'Ubuntu' {
Copy link

@goetzk goetzk Jan 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this same split is applicable for Debian from the next release:
Stable + Oldstable Python 2 https://packages.debian.org/buster/duplicity
Testing python 3 https://packages.debian.org/bullseye/duplicity
I'm not sure when the next release of this role will be but this might be relevant as the next Debian release is expected in 2-3 months. https://wiki.debian.org/DebianBullseye

$duply_paramiko_package_name = versioncmp($facts['os']['release']['major'], '20.04') >= 0 ? {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabling backups of 20.04 systems would be of interest to me too. @punycode is there any help I can provide in getting this included?

true => 'python3-paramiko',
default => 'python-paramiko',
}
} elsif $facts['os']['name'] == 'Fedora' {
$duply_paramiko_package_name = versioncmp($facts['os']['release']['major'], '31') >= 0 ? {
true => 'python3-paramiko',
default => 'python2-paramiko',
}
} elsif $facts['os']['family'] == 'RedHat' {
$duply_paramiko_package_name = versioncmp($facts['os']['release']['major'], '8') >= 0 ? {
true => 'python3-paramiko',
default => 'python2-paramiko',
}
} else {
$duply_paramiko_package_name = 'python-paramiko'
}

$duply_extra_packages = []
$duply_archive_version = '2.2.2'
$duply_archive_checksum = '3cf4a2803173726b136b6fe030334bb42045b4d9'
Expand Down Expand Up @@ -54,4 +74,5 @@

$cron_enabled = false
$exec_path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'

}