From 271f218dd7c682fc7618f738faaceb6b59242a4b Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 30 Oct 2024 12:50:13 +0100 Subject: [PATCH] Update default version from 1.16.3->1.20.0 --- REFERENCE.md | 2 +- manifests/init.pp | 2 +- spec/acceptance/class_spec.rb | 12 +++++------- spec/classes/init_spec.rb | 14 +++++++------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 44c31fbd..e991e0b6 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -552,7 +552,7 @@ Data type: `String[1]` Specify version of consul binary to download. -Default value: `'1.16.3'` +Default value: `'1.20.0'` ##### `watches` diff --git a/manifests/init.pp b/manifests/init.pp index 8e9f2453..e380af22 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -140,7 +140,7 @@ Enum['stopped', 'running'] $service_ensure = 'running', Hash $services = {}, String[1] $user = $consul::params::user, - String[1] $version = '1.16.3', + String[1] $version = '1.20.0', Hash $watches = {}, Optional[String[1]] $shell = $consul::params::shell, Boolean $enable_beta_ui = false, diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index bf848346..253f147e 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -6,7 +6,7 @@ pp = <<-EOS package { 'unzip': ensure => present } -> class { 'consul': - version => '1.16.0', + version => '1.16.3', manage_service => true, config_hash => { 'data_dir' => '/opt/consul', @@ -32,7 +32,7 @@ end describe command('consul version') do - its(:stdout) { is_expected.to match %r{Consul v1.16.0} } + its(:stdout) { is_expected.to match %r{Consul v1.16.3} } end describe file('/etc/consul/config.json') do @@ -46,7 +46,7 @@ pp = <<-EOS package { 'unzip': ensure => present } -> class { 'consul': - version => '1.16.3', + version => '1.20.0', manage_service => true, config_hash => { 'datacenter' => 'east-aws', @@ -73,7 +73,7 @@ end describe command('consul version') do - its(:stdout) { is_expected.to match %r{Consul v1.16.3} } + its(:stdout) { is_expected.to match %r{Consul v1.20.0} } end describe file('/etc/consul/config.json') do @@ -87,7 +87,6 @@ pp = <<-EOS package { 'unzip': ensure => present } -> class { 'consul': - version => '1.16.3', manage_service => true, config_hash => { 'datacenter' => 'east-aws', @@ -133,7 +132,6 @@ pp = <<-EOS package { 'unzip': ensure => present } -> class { 'consul': - version => '1.16.3', manage_service => true, config_hash => { 'datacenter' => 'east-aws', @@ -207,7 +205,7 @@ end describe command('consul version') do - its(:stdout) { is_expected.to match %r{Consul v1.16.3} } + its(:stdout) { is_expected.to match %r{Consul v1.20.0} } end describe command("consul acl token list --token #{acl_master_token} | grep Description") do diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 354ca43b..fbfcb666 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -145,9 +145,9 @@ end context 'When installing via URL by default' do - it { is_expected.to contain_archive('/opt/consul/archives/consul-1.16.3.zip').with(source: 'https://releases.hashicorp.com/consul/1.16.3/consul_1.16.3_linux_amd64.zip') } + it { is_expected.to contain_archive('/opt/consul/archives/consul-1.20.0.zip').with(source: 'https://releases.hashicorp.com/consul/1.20.0/consul_1.20.0_linux_amd64.zip') } it { is_expected.to contain_file('/opt/consul/archives').with(ensure: 'directory') } - it { is_expected.to contain_file('/opt/consul/archives/consul-1.16.3').with(ensure: 'directory') } + it { is_expected.to contain_file('/opt/consul/archives/consul-1.20.0').with(ensure: 'directory') } it { is_expected.to contain_file('/usr/local/bin/consul').that_notifies('Class[consul::run_service]') } end @@ -158,20 +158,20 @@ } end - it { is_expected.to contain_archive('/usr/share/puppet-archive/consul-1.16.3.zip').with(source: 'https://releases.hashicorp.com/consul/1.16.3/consul_1.16.3_linux_amd64.zip') } + it { is_expected.to contain_archive('/usr/share/puppet-archive/consul-1.20.0.zip').with(source: 'https://releases.hashicorp.com/consul/1.20.0/consul_1.20.0_linux_amd64.zip') } it { is_expected.to contain_file('/usr/share/puppet-archive').with(ensure: 'directory') } - it { is_expected.to contain_file('/usr/share/puppet-archive/consul-1.16.3').with(ensure: 'directory') } + it { is_expected.to contain_file('/usr/share/puppet-archive/consul-1.20.0').with(ensure: 'directory') } it { is_expected.to contain_file('/usr/local/bin/consul').that_notifies('Class[consul::run_service]') } end context 'When installing by archive via URL and current version is already installed' do let(:facts) do os_facts.merge({ - consul_version: '1.16.3' + consul_version: '1.20.0' }) end - it { is_expected.to contain_archive('/opt/consul/archives/consul-1.16.3.zip').with(source: 'https://releases.hashicorp.com/consul/1.16.3/consul_1.16.3_linux_amd64.zip') } + it { is_expected.to contain_archive('/opt/consul/archives/consul-1.20.0.zip').with(source: 'https://releases.hashicorp.com/consul/1.20.0/consul_1.20.0_linux_amd64.zip') } it { is_expected.to contain_file('/usr/local/bin/consul') } it { is_expected.not_to contain_notify(['Class[consul::run_service]']) } end @@ -194,7 +194,7 @@ } end - it { is_expected.to contain_archive('/opt/consul/archives/consul-1.16.3.zip').with(source: 'http://myurl') } + it { is_expected.to contain_archive('/opt/consul/archives/consul-1.20.0.zip').with(source: 'http://myurl') } it { is_expected.to contain_file('/usr/local/bin/consul').that_notifies('Class[consul::run_service]') } end