diff --git a/deployment_scripts/puppet/manifests/influxdb.pp b/deployment_scripts/puppet/manifests/influxdb.pp index bddfe83c..6436f68f 100644 --- a/deployment_scripts/puppet/manifests/influxdb.pp +++ b/deployment_scripts/puppet/manifests/influxdb.pp @@ -44,5 +44,6 @@ class { 'lma_monitoring_analytics::influxdb': base_directory => $data_directory, hostname => hiera('lma::influxdb::listen_address'), raft_nodes => $raft_nodes, + version => '0.11.1-1', require => File[$data_directory], } diff --git a/deployment_scripts/puppet/modules/influxdb/manifests/init.pp b/deployment_scripts/puppet/modules/influxdb/manifests/init.pp index 4e688521..7fa9c575 100644 --- a/deployment_scripts/puppet/modules/influxdb/manifests/init.pp +++ b/deployment_scripts/puppet/modules/influxdb/manifests/init.pp @@ -20,12 +20,20 @@ class influxdb ( $meta_dir = $influxdb::params::meta_dir, $wal_dir = $influxdb::params::wal_dir, $snapshot = $influxdb::params::snapshot, + $version = undef, $hostname = undef, $raft_nodes = undef, ) inherits influxdb::params { + if $version { + $use_version = $version + } else { + $use_version = 'latest' + } + class {'influxdb::install': - raft_nodes => $raft_nodes, + raft_nodes => $raft_nodes, + version => $use_version, } class {'influxdb::service': diff --git a/deployment_scripts/puppet/modules/influxdb/manifests/install.pp b/deployment_scripts/puppet/modules/influxdb/manifests/install.pp index 15d7307c..e43118b1 100644 --- a/deployment_scripts/puppet/modules/influxdb/manifests/install.pp +++ b/deployment_scripts/puppet/modules/influxdb/manifests/install.pp @@ -15,11 +15,12 @@ # == Class: influxdb::install class influxdb::install ( - $raft_nodes = undef, + $raft_nodes = undef, + $version = 'latest', ) { package { 'influxdb': - ensure => installed, + ensure => $version, } if $raft_nodes { diff --git a/deployment_scripts/puppet/modules/influxdb/spec/classes/influxdb_install_spec.rb b/deployment_scripts/puppet/modules/influxdb/spec/classes/influxdb_install_spec.rb index d3bf5646..138361b4 100644 --- a/deployment_scripts/puppet/modules/influxdb/spec/classes/influxdb_install_spec.rb +++ b/deployment_scripts/puppet/modules/influxdb/spec/classes/influxdb_install_spec.rb @@ -20,7 +20,15 @@ describe 'influxdb::install' do end describe 'with defaults' do - it { is_expected.to contain_package('influxdb').with_ensure('installed') } + it { is_expected.to contain_package('influxdb').with_ensure('latest') } + it { is_expected.to have_file_count(0) } + end + + describe 'with version' do + let (:params) do + {:version => '0.1.2.3'} + end + it { is_expected.to contain_package('influxdb').with_ensure('0.1.2.3') } it { is_expected.to have_file_count(0) } end @@ -28,7 +36,7 @@ describe 'influxdb::install' do let(:params) do {:raft_nodes => ['node-1', 'node-2']} end - it { is_expected.to contain_package('influxdb').with_ensure('installed') } + it { is_expected.to contain_package('influxdb').with_ensure('latest') } it { is_expected.to contain_file('/etc/default/influxdb') } end end diff --git a/deployment_scripts/puppet/modules/lma_monitoring_analytics/manifests/influxdb.pp b/deployment_scripts/puppet/modules/lma_monitoring_analytics/manifests/influxdb.pp index 0a17d0ca..e3c35974 100644 --- a/deployment_scripts/puppet/modules/lma_monitoring_analytics/manifests/influxdb.pp +++ b/deployment_scripts/puppet/modules/lma_monitoring_analytics/manifests/influxdb.pp @@ -18,6 +18,7 @@ class lma_monitoring_analytics::influxdb ( $base_directory = $lma_monitoring_analytics::params::influxdb_dir, $hostname = undef, $raft_nodes = undef, + $version = undef, ) inherits lma_monitoring_analytics::params { if $raft_nodes { @@ -32,5 +33,6 @@ class lma_monitoring_analytics::influxdb ( snapshot => true, hostname => $hostname, raft_nodes => $raft_nodes, + version => $version, } }