voxpupuli / puppet-nomad

Puppet module for managing Nomad
Apache License 2.0
16 stars 31 forks source link

exec statement "reload nomad service" contains wrong command #75

Closed maxadamo closed 1 year ago

maxadamo commented 1 year ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

the command defined here: https://github.com/voxpupuli/puppet-nomad/blob/master/manifests/reload_service.pp#L21 doesn't look quite right with the versions of Nomad that I am using. I tried with Nomad 1.4.x and 1.5.0 and it doesn't work

What are you seeing

throws an error: the command is wrong.

Any additional information you'd like to impart

I'm still trying to figure out the proper command (if one still exists)

maxadamo commented 1 year ago
  1. the systemd service provided with this module has an option to reload the service: https://github.com/voxpupuli/puppet-nomad/blob/master/templates/nomad.systemd.erb#L8
  2. this module supports systemd only
  3. the systemd file provided with the Hashicorp package has always had an option to reload the service (I checked Nomad version 0.10.6 RPM and DEB)
  4. perhaps nomad reload command was removed, in favour of sending a HUP signal to the daemon: https://developer.hashicorp.com/nomad/docs/configuration#configuration-reload

I don't see a point to use any alternative command, and I would do the following:

remove this one:

exec { 'reload nomad service':
  path        => [$nomad::bin_dir,'/bin','/usr/bin'],
  command     => "nomad reload -rpc-addr=${rpc_addr}:${nomad::rpc_port}",
  refreshonly => true,
}

add this one:

exec { 'reload nomad service':
  path        => ['/bin', '/usr/bin'],
  command     => 'systemctl reload nomad.service',
  refreshonly => true,
}