ansible-role-hashicorp
ansible-role-hashicorp copied to clipboard
Introduce support for installing specific versions using package method
Proposed feature
Introduce support for installing specific versions using package method. HashiCorp repos have majority of versions available in all of their repos.
Ability to also use version lock provided by package managers would be great but it would need much more effort to implement.
Rationale
When building golden images with security only update policy the specific version installed from repositories will remain until new replacement image is built. Ability to select specific version to install using packages is then roughly equivalent to manual method with extra goodies like systemd unit files.
Playbook with version locked in code and bumped via eg Renovate would allow to better align with IaC approach and provide for a better control when to migrate to a newer version or apply specific configuration changes
Additional context
Version locking and whether to force downgrade are other aspects to be considered but those are dependent on specific package managers and might be non-trivial for a generic role.
Default behavior of different package managers might be an issue when it comes to downgrades.
Fedora package manager dnf would downgrade already installed package if version explicitly specified as eg nomad-1.0.0 but yum would refuse.
Please consider sponsoring me.
Hi,
Thanks for the feedback. I've modified the assert.yml a bit to allow version to be used.
See the updated converge.yml for an example. (It's also in the README.md.)
Does this help you?
It will work for me.
As a general feature supporting multiple OSes simultaneously it might need to be done with a separate version variable.
Afaik with apt-get the expected format is package=version and I don't know it's behavior when newer version is already installed. I think it will downgrade to requested version same as with dnf. RHEL 8 and newer uses DNF now too. Amazon Linux 2022 is Fedora based, so likely dnf as well, but Amazon Linux 2 uses yum and that one can not downgrade with install command. Attempt to downgrade with yum will probably cause the role to error out.