-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aligning with upstream package layout, stdlib::to_json and install method #48
Conversation
REFERENCE.md
Outdated
@@ -34,8 +29,7 @@ Installs, configures, and manages nomad | |||
|
|||
```puppet | |||
class { 'nomad': | |||
version => '1.0.2', # check latest version at https://github.com/hashicorp/nomad/blob/master/CHANGELOG.md | |||
config_hash => { | |||
config_hash => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This alignment looks off
config_hash => { | |
config_hash => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, i pushed a fix
data/os/RedHat.yaml
Outdated
@@ -0,0 +1,2 @@ | |||
--- | |||
nomad::bin_dir: /bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Red Hat /bin
is a symlink to /usr/bin
, right? So can't we just unify on /usr/bin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are absolutely right again, pushed a fix
38069d3
to
6f314c5
Compare
6f314c5
to
befe33c
Compare
# config_hash => { | ||
# 'region' => 'us-west', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I always use quotes in hashes rather than string literals. I'm not sure whether you really need to change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i normally dont, but reverted it cause i dont care that much either way
manifests/init.pp
Outdated
# @param bin_dir | ||
# location of the nomad binary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep the old parameter instead of moving it around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
manifests/init.pp
Outdated
@@ -129,28 +126,27 @@ | |||
# 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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I'd keep it on the same line as before for a smaller diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved it back into place
spec/acceptance/url_spec.rb
Outdated
describe file('/usr/local/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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are the bin directories different here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by mistake, i fixed the check now
d84af7d
to
8467659
Compare
8467659
to
50466d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small suggestion, but otherwise 👍
end | ||
end | ||
|
||
describe service('nomad') do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also be_running
as a check. Might be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Pull Request (PR) description
Now that HashiCorp provides upstream packages (for x64 at least) we can make this the default install method. I also made sure the bin_dir and config_dir defaults map to the directories set in these upstream packages.
Also switching to the package provided systemd service file, but leaving the ability to manage your own.
I also removed the custom functions that were used to write the config, since the upstream
.to_json
and.to_json_pretty
produce stable output in my tests.This Pull Request (PR) fixes the following issues
Fixes #45
Fixes #23