ansible-collections / ansible-consul

:satellite: Ansible role for Hashicorp Consul clusters
https://galaxy.ansible.com/ansible-community/consul/
BSD 2-Clause "Simplified" License
450 stars 313 forks source link

Add support for configuration validation #565

Closed bastienwirtz closed 6 months ago

bastienwirtz commented 1 year ago

This patch add an additional step to ensure the config is valid after creating it. It also add the validation at the systemd level, this makes possible to get an error exit code when you restart consul with a faulty configuration.

Related to https://github.com/ansible-community/ansible-consul/issues/518

bastienwirtz commented 1 year ago

@nre-ableton I added a commit to validate the configuration using the consul user. Some config checks can involve the user context (like checking the max open file descriptor allowed, which can be set at the user level (ulimit)).

bastienwirtz commented 7 months ago

We should be good here too @nre-ableton

nre-ableton commented 7 months ago

Hmm, something is weird with CI. I'm not sure that the merge commit went as intended...

If I have time this afternoon, I'll try to fix it and force-push to your branch. Can you please make sure that this PR has the option ticked to allow contributions from owners?

bastienwirtz commented 7 months ago

edits by maintainers is enabled, that should be all good.

nre-ableton commented 7 months ago

Ok, there are two issues that cause CI to fail:

nre-ableton commented 6 months ago

@bastienwirtz Could you please rebase this branch and see if CI is still broken (hopefully that's not the case). It would be nice to dust off this PR and get it merged.

nre-ableton commented 6 months ago

Bummer, looks like the CI problem is still there. I'll have a look into it today, if I have time.

nre-ableton commented 6 months ago

@bastienwirtz I pushed some fixups to your branch in an (unsuccessful) attempt to fix CI. Feel free to drop them all and force-push.

bastienwirtz commented 6 months ago

replaced by https://github.com/ansible-collections/ansible-consul/pull/592