From c2e7e2bc48d5689c9d321b3a0ba572bc57c18bb2 Mon Sep 17 00:00:00 2001 From: Alexander Hoke Date: Fri, 13 Apr 2018 10:17:24 +0200 Subject: [PATCH] add dependency on ::repo for ::install if manage_repo is enabled. Otherwise ::install can be called before ::repo and installs the OS native package, which in case of Debian9 does not provide the influx client and thus causes influxdb_database and influxdb_retention_policy to fail until the next apt upgrade. Also moved to ensure_packages from already present stdlib dependency to declare resources more safely in case of duplicates in the catalog. --- manifests/install.pp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/manifests/install.pp b/manifests/install.pp index aad1151..05f27b6 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -13,7 +13,12 @@ } } - package { $packages : - ensure => $::influxdb::package_ensure, + if $::influxdb::manage_repo { + ensure_packages($packages, { + ensure => $::influxdb::package_ensure, + require => Class['::influxdb::repo'], + }) + } else { + ensure_packages($packages, {ensure => $::influxdb::package_ensure}) } }