forked from jsok/puppet-vault
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#29) Ensure vault is updated when version changes
This PR fixes the issue that version is not updated on parameter change. This is due the nature of creates parameter in archive. This PR is creating a fact of vaults version and compares it against the parameter. If parameter is newer it will download the archive and extract it. This will not reboot vault server. Please be aware to restart vault server, so vault sources the new binary. Fixes #29 Cherry-picked and rebased from #52
- Loading branch information
1 parent
df3a940
commit 4a7506e
Showing
5 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
# Fact: vault_version | ||
# | ||
# Purpose: Retrieve vault version if installed | ||
# | ||
Facter.add(:vault_version) do | ||
confine { Facter::Util::Resolution.which('vault') } | ||
setcode do | ||
vault_server_version_output = Facter::Util::Resolution.exec('vault version') | ||
match = vault_server_version_output.match(%r{Vault v(\d+\.\d+\.\d+)}) | ||
match&.captures&.first | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters