From 8467659ce55e2fd889d5c9fa5b2982f8e5d80a7c Mon Sep 17 00:00:00 2001 From: Bram Vogelaar Date: Wed, 10 Feb 2021 17:25:51 +0100 Subject: [PATCH] reverting back to quoted hashes, fixing file location in tests --- REFERENCE.md | 70 ++++++++++++++++++------------------- manifests/init.pp | 60 +++++++++++++++---------------- spec/acceptance/url_spec.rb | 4 +-- 3 files changed, 67 insertions(+), 67 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index e37dede..aa4de8b 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -30,14 +30,14 @@ Installs, configures, and manages nomad ```puppet class { 'nomad': config_hash => { - region => 'us-west', - datacenter => 'ptk', - log_level => 'INFO', - bind_addr => '0.0.0.0', - data_dir => '/opt/nomad', - server => { - enabled => true, - bootstrap_expect => 3, + 'region' => 'us-west', + 'datacenter' => 'ptk', + 'log_level' => 'INFO', + 'bind_addr' => '0.0.0.0', + 'data_dir' => '/opt/nomad', + 'server' => { + 'enabled' => true, + 'bootstrap_expect' => 3, } } } @@ -48,14 +48,14 @@ class { 'nomad': ```puppet class { 'nomad': config_hash => { - region => 'us-west', - datacenter => 'ptk', - log_level => 'INFO', - bind_addr => '0.0.0.0', - data_dir => '/opt/nomad', - client => { - enabled => true, - servers => [ + 'region' => 'us-west', + 'datacenter' => 'ptk', + 'log_level' => 'INFO', + 'bind_addr' => '0.0.0.0', + 'data_dir' => '/opt/nomad', + 'client' => { + 'enabled' => true, + 'servers' => [ "nomad01.your-org.pvt:4647", "nomad02.your-org.pvt:4647", "nomad03.your-org.pvt:4647" @@ -74,14 +74,14 @@ class { 'nomad': manage_service_file => true, version => '1.0.3', # check latest version at https://github.com/hashicorp/nomad/blob/master/CHANGELOG.md config_hash => { - region => 'us-west', - datacenter => 'ptk', - log_level => 'INFO', - bind_addr => '0.0.0.0', - data_dir => '/opt/nomad', - client => { - enabled => true, - servers => [ + 'region' => 'us-west', + 'datacenter' => 'ptk', + 'log_level' => 'INFO', + 'bind_addr' => '0.0.0.0', + 'data_dir' => '/opt/nomad', + 'client' => { + 'enabled' => true, + 'servers' => [ "nomad01.your-org.pvt:4647", "nomad02.your-org.pvt:4647", "nomad03.your-org.pvt:4647" @@ -103,9 +103,9 @@ class { 'nomad': log_level => 'INFO', bind_addr => '0.0.0.0', data_dir => '/opt/nomad', - client => { - enabled => true, - servers => [ + 'client' => { + 'enabled' => true, + 'servers' => [ "nomad01.your-org.pvt:4647", "nomad02.your-org.pvt:4647", "nomad03.your-org.pvt:4647" @@ -125,14 +125,6 @@ Data type: `String[1]` cpu architecture -##### `bin_dir` - -Data type: `Stdlib::Absolutepath` - -location of the nomad binary - -Default value: `'/usr/bin'` - ##### `purge_config_dir` Data type: `Boolean` @@ -149,6 +141,14 @@ join nomad cluster over the WAN Default value: ``undef`` +##### `bin_dir` + +Data type: `Stdlib::Absolutepath` + +location of the nomad binary + +Default value: `'/usr/bin'` + ##### `version` Data type: `String[1]` diff --git a/manifests/init.pp b/manifests/init.pp index b786dd0..1a775bb 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -3,14 +3,14 @@ # @example To set up a single nomad server, with several agents attached, on the server. # class { 'nomad': # config_hash => { -# region => 'us-west', -# datacenter => 'ptk', -# log_level => 'INFO', -# bind_addr => '0.0.0.0', -# data_dir => '/opt/nomad', -# server => { -# enabled => true, -# bootstrap_expect => 3, +# 'region' => 'us-west', +# 'datacenter' => 'ptk', +# 'log_level' => 'INFO', +# 'bind_addr' => '0.0.0.0', +# 'data_dir' => '/opt/nomad', +# 'server' => { +# 'enabled' => true, +# 'bootstrap_expect' => 3, # } # } # } @@ -18,14 +18,14 @@ # @example On the agent(s) # class { 'nomad': # config_hash => { -# region => 'us-west', -# datacenter => 'ptk', -# log_level => 'INFO', -# bind_addr => '0.0.0.0', -# data_dir => '/opt/nomad', -# client => { -# enabled => true, -# servers => [ +# 'region' => 'us-west', +# 'datacenter' => 'ptk', +# 'log_level' => 'INFO', +# 'bind_addr' => '0.0.0.0', +# 'data_dir' => '/opt/nomad', +# 'client' => { +# 'enabled' => true, +# 'servers' => [ # "nomad01.your-org.pvt:4647", # "nomad02.your-org.pvt:4647", # "nomad03.your-org.pvt:4647" @@ -41,14 +41,14 @@ # manage_service_file => true, # version => '1.0.3', # check latest version at https://github.com/hashicorp/nomad/blob/master/CHANGELOG.md # config_hash => { -# region => 'us-west', -# datacenter => 'ptk', -# log_level => 'INFO', -# bind_addr => '0.0.0.0', -# data_dir => '/opt/nomad', -# client => { -# enabled => true, -# servers => [ +# 'region' => 'us-west', +# 'datacenter' => 'ptk', +# 'log_level' => 'INFO', +# 'bind_addr' => '0.0.0.0', +# 'data_dir' => '/opt/nomad', +# 'client' => { +# 'enabled' => true, +# 'servers' => [ # "nomad01.your-org.pvt:4647", # "nomad02.your-org.pvt:4647", # "nomad03.your-org.pvt:4647" @@ -67,9 +67,9 @@ # log_level => 'INFO', # bind_addr => '0.0.0.0', # data_dir => '/opt/nomad', -# client => { -# enabled => true, -# servers => [ +# 'client' => { +# 'enabled' => true, +# 'servers' => [ # "nomad01.your-org.pvt:4647", # "nomad02.your-org.pvt:4647", # "nomad03.your-org.pvt:4647" @@ -80,12 +80,12 @@ # # @param arch # cpu architecture -# @param bin_dir -# location of the nomad binary # @param purge_config_dir # Purge config files no longer generated by Puppet # @param join_wan # join nomad cluster over the WAN +# @param bin_dir +# location of the nomad binary # @param version # Specify version of nomad binary to download. # @param install_method @@ -126,9 +126,9 @@ # Determines whether to restart nomad agent on $config_hash changes. This will not affect reloads when service, check or watch configs change. class nomad ( String[1] $arch, - Stdlib::Absolutepath $bin_dir = '/usr/bin', Boolean $purge_config_dir = true, Optional[String[1]] $join_wan = undef, + Stdlib::Absolutepath $bin_dir = '/usr/bin', String[1] $version = 'installed', Enum['none', 'package', 'url'] $install_method = 'package', String[1] $os = downcase($facts['kernel']), diff --git a/spec/acceptance/url_spec.rb b/spec/acceptance/url_spec.rb index 63b6924..955125c 100644 --- a/spec/acceptance/url_spec.rb +++ b/spec/acceptance/url_spec.rb @@ -42,12 +42,12 @@ class { 'nomad': case os[:family] when 'Debian' - describe file('/usr/local/bin/nomad') do + describe file('/usr/bin/nomad') do it { should be_symlink } it { should be_linked_to '/opt/puppet-archive/nomad-1.0.3/nomad' } end when 'RedHat' - describe file('/bin/nomad') do + describe file('/usr/bin/nomad') do it { should be_symlink } it { should be_linked_to '/opt/puppet-archive/nomad-1.0.3/nomad' } end