From ac820ea311edc5f4a32504ec451e25739e33621d Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 5 Jul 2018 16:43:25 +0200 Subject: [PATCH 1/3] add datatypes for params in consul::config --- manifests/config.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index ad317c3e..ec1d55ba 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -11,9 +11,9 @@ # Bool. If set will make puppet remove stale config files. # class consul::config( - $config_hash, - $purge = true, - $enable_beta_ui = $consul::enable_beta_ui, + Hash $config_hash, + Boolean $purge = true, + Boolean $enable_beta_ui = $consul::enable_beta_ui, Boolean $allow_binding_to_root_ports = $consul::allow_binding_to_root_ports, Boolean $restart_on_change = $consul::restart_on_change, ) { From bf02d15de8991a7592ed6cc29186ce6c3fc76d38 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 5 Jul 2018 16:45:44 +0200 Subject: [PATCH 2/3] verify that performance options work --- spec/acceptance/class_spec.rb | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index 5f04cee3..18616fda 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -75,5 +75,44 @@ class { 'consul': end end + context 'with performance options' do + it 'should work with no errors based on the example' do + pp = <<-EOS + package { 'unzip': ensure => present } -> + # Don't manage the service as it doesn't work well in docker + class { 'consul': + version => '1.2.0', + manage_service => true, + config_hash => { + 'datacenter' => 'east-aws', + 'data_dir' => '/opt/consul', + 'log_level' => 'INFO', + 'node_name' => 'foobar', + 'server' => true, + 'performance' => { + 'raft_multiplier' => 2, + }, + } + } + EOS + + # Run it twice and test for idempotency + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_changes: true) + end + + describe file('/opt/consul') do + it { should be_directory } + end + + describe service('consul') do + it { should be_enabled } + it { should be_running } + end + describe command('consul version') do + its(:stdout) { should match %r{Consul v1.2.0} } + end + + end end From 455f466628b29fa9778bbc8d1b13f71484f2c2e9 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 5 Jul 2018 18:29:53 +0200 Subject: [PATCH 3/3] drop wrong inline comment --- spec/acceptance/class_spec.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index 18616fda..3b91bc7a 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -6,7 +6,6 @@ it 'should work with no errors based on the example' do pp = <<-EOS package { 'unzip': ensure => present } -> - # Don't manage the service as it doesn't work well in docker class { 'consul': version => '1.0.5', manage_service => true, @@ -42,7 +41,6 @@ class { 'consul': it 'should work with no errors based on the example' do pp = <<-EOS package { 'unzip': ensure => present } -> - # Don't manage the service as it doesn't work well in docker class { 'consul': version => '1.1.0', manage_service => true, @@ -79,7 +77,6 @@ class { 'consul': it 'should work with no errors based on the example' do pp = <<-EOS package { 'unzip': ensure => present } -> - # Don't manage the service as it doesn't work well in docker class { 'consul': version => '1.2.0', manage_service => true,