ansible-collections / ansible-consul

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

Support upgrading consul when version changes #507

Closed nre-ableton closed 1 year ago

nre-ableton commented 1 year ago

This PR introduces a new variable, consul_force_install, which when true, will forcibly install Consul on the host. Otherwise, when this role runs, the Consul version is inspected with consul --version and compared to consul_version to determine if an upgrade is necessary. Thus, the consul_install_upgrade variable is no longer necessary and has been removed by this PR.

This PR also contains a few small cleanups and fixes, primarily for Windows (which I suspect is somewhat less rigorously tested than other platforms).

I have tested these changes locally to make sure that initial installation, idempotent installation, and an upgrade all work correctly. I have tested on the following platforms:

Fixes https://github.com/ansible-community/ansible-consul/issues/87

bbaassssiiee commented 1 year ago

Thanks!

nre-ableton commented 1 year ago

@bbaassssiiee Thank you for the reviews and merges!