From 774906581842f44a23f2efc848de9cfc7b8d3137 Mon Sep 17 00:00:00 2001 From: Matthias Baur Date: Tue, 17 Jul 2018 13:30:37 +0200 Subject: [PATCH] Change default of version parameter to 'installed' Fixes GH-125. --- README.md | 3 +-- manifests/init.pp | 4 ++-- manifests/params.pp | 2 +- spec/classes/grafana_spec.rb | 10 ++++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5717a505f..eafffc590 100644 --- a/README.md +++ b/README.md @@ -342,8 +342,7 @@ Defaults to 'grafana-server'. ##### `version` -The version of Grafana to install and manage. Defaults to the latest version of -Grafana available at the time of module release. +The version of Grafana to install and manage. Defaults to 'installed' ##### `sysconfig_location` diff --git a/manifests/init.pp b/manifests/init.pp index b7c498c61..302b589e4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -54,7 +54,7 @@ # # [*version*] # The version of Grafana to install and manage. -# Defaults to the latest version of Grafana available at the time of module release. +# Defaults to 'installed' # # [*repo_name*] # When using 'repo' install_method, the repo to look for packages in. @@ -122,7 +122,7 @@ Enum['stable', 'testing'] $repo_name = $::grafana::params::repo_name, String $rpm_iteration = $::grafana::params::rpm_iteration, String $service_name = $::grafana::params::service_name, - String $version = $::grafana::params::version, + String $version = 'installed', Hash $plugins = {}, Hash $provisioning_dashboards = {}, Hash $provisioning_datasources = {}, diff --git a/manifests/params.pp b/manifests/params.pp index 9e92700d6..3d4c0affa 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -14,10 +14,10 @@ $package_name = 'grafana' $rpm_iteration = '1' $repo_name = 'stable' - $version = '4.5.1' $create_subdirs_provisioning = false $provisioning_dashboards_file = '/etc/grafana/provisioning/dashboards/puppetprovisioned.yaml' $provisioning_datasources_file = '/etc/grafana/provisioning/datasources/puppetprovisioned.yaml' + case $facts['os']['family'] { 'Archlinux': { $manage_package_repo = false diff --git a/spec/classes/grafana_spec.rb b/spec/classes/grafana_spec.rb index 9237efa67..91dbeae72 100644 --- a/spec/classes/grafana_spec.rb +++ b/spec/classes/grafana_spec.rb @@ -37,7 +37,8 @@ context 'with parameter install_method is set to package' do let(:params) do { - install_method: 'package' + install_method: 'package', + version: '4.5.1', } end @@ -108,7 +109,7 @@ end describe 'install the package' do - it { is_expected.to contain_package('grafana').with_ensure('4.5.1') } + it { is_expected.to contain_package('grafana').with_ensure('installed') } end when 'RedHat' describe 'yum repo dependencies first' do @@ -121,7 +122,7 @@ end describe 'install the package' do - it { is_expected.to contain_package('grafana').with_ensure('4.5.1-1') } + it { is_expected.to contain_package('grafana').with_ensure('installed') } end end end @@ -162,7 +163,8 @@ context 'with parameter install_method is set to archive' do let(:params) do { - install_method: 'archive' + install_method: 'archive', + version: '4.5.1', } end