Skip to content
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

alternative commands to Consul Reload #629

Open
lukebigum opened this issue Jul 24, 2023 · 0 comments
Open

alternative commands to Consul Reload #629

lukebigum opened this issue Jul 24, 2023 · 0 comments

Comments

@lukebigum
Copy link

lukebigum commented Jul 24, 2023

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7
  • Module version: HEAD

What are you seeing

The Exec inside consul::reload_service never works for me. Trying to reload Consul via the Consul CLI is the most universal method, however it means a token must be in place for it to work. I use ACLs, and I will not pass any token to Puppet for security reasons.

If I were to submit a PR to optionally change the behaviour of consul::reload_service to call out to systemctl reload consul if $facts['systemd'] plus another class Boolean, would that be acceptable? It's not pretty, but it's the best I've got.

The other thing I can do is spaceship operator and override:

Exec <| title == 'reload consul service' |> {
  command => 'systemctl reload consul'
}

Which is even nastier, but it'll work for me.

Output log

Notice: /Stage[main]/Consul::Reload_service/Exec[reload consul service]/returns: Error reloading: Unexpected response code: 403 (Permission denied: anonymous token lacks permission 'agent:write' on "hostname". The anonymous token is used implicitly when a request does not specify a token.)
Error: /Stage[main]/Consul::Reload_service/Exec[reload consul service]: Failed to call refresh: 'consul reload -http-addr=127.0.0.1:8500' returned 1 instead of one of [0]
Error: /Stage[main]/Consul::Reload_service/Exec[reload consul service]: 'consul reload -http-addr=127.0.0.1:8500' returned 1 instead of one of [0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant