Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #23 from duncangibb/debian-ubuntu-updates
Browse files Browse the repository at this point in the history
Updates for more recent Debian and Ubuntu packages
  • Loading branch information
rockyluke authored Jun 18, 2020
2 parents e2a3136 + a9018a8 commit 0ba4e43
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
15 changes: 11 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$service = true,
$enable = true,
$manage_repo = true,
$split_client_package = false,
$apt_location = $influxdb::params::apt_location,
$apt_release = $influxdb::params::apt_release,
$apt_repos = $influxdb::params::apt_repos,
Expand Down Expand Up @@ -47,6 +48,12 @@
$graphite_templates = $influxdb::params::graphite_templates

) inherits influxdb::params {
case $split_client_package {
true : { $package_names = $influxdb_package_name }
false : { $package_names = [$influxdb_package_name[0]] }
default : { fail('split_client_package package must be true (if using Debian/Ubuntu distro packages) or false') }
}

case $package {
true : { $ensure_package = 'present' }
false : { $ensure_package = 'purged' }
Expand All @@ -67,17 +74,17 @@
apt_release => $apt_release,
apt_repos => $apt_repos,
apt_key => $apt_key,
influxdb_package_name => $influxdb_package_name,
influxdb_package_name => $package_names,
influxdb_service_name => $influxdb_service_name,
}

package { $influxdb_package_name[0]:
package { $package_names:
ensure => $ensure_package,
require => Class['influxdb::repos'],
}
}
else {
package { $influxdb_package_name:
package { $package_names:
ensure => $ensure_package
}
}
Expand All @@ -88,7 +95,7 @@
hasrestart => true,
hasstatus => true,
provider => $influxdb_service_provider,
require => Package[$influxdb_package_name[0]],
require => Package[$package_names[0]],
}

if $ensure_service == 'running' {
Expand Down
4 changes: 2 additions & 2 deletions manifests/repos.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
case $::operatingsystem {
/(?i:debian|devuan|ubuntu)/: {
case $::lsbdistcodename {
/(buster|n\/a)/ : {
/(bullseye|n\/a)/ : {
if !defined(Class['apt']) {
include apt
}

apt::source { 'influxdb':
ensure => present,
location => $apt_location,
release => 'jessie',
release => 'buster',
repos => 'stable',
key => $apt_key,
notify => Exec['apt_update']
Expand Down

0 comments on commit 0ba4e43

Please sign in to comment.