Skip to content

Commit

Permalink
reverting back to quoted hashes, fixing file location in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
attachmentgenie committed Feb 10, 2021
1 parent befe33c commit 8467659
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 67 deletions.
70 changes: 35 additions & 35 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
}
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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`
Expand All @@ -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]`
Expand Down
60 changes: 30 additions & 30 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
# @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,
# }
# }
# }
#
# @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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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']),
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/url_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8467659

Please sign in to comment.