2021-06-21 12:27:04 +00:00
|
|
|
# Install `Consul`:
|
|
|
|
KEYSRV = "https://apt.releases.hashicorp.com/gpg"
|
2023-01-28 01:34:06 +00:00
|
|
|
ID = "AA16FCBCA621E701"
|
2021-06-21 12:27:04 +00:00
|
|
|
|
|
|
|
execute "apt-key adv --keyserver #{KEYSRV} --recv-keys #{ID}" do
|
|
|
|
not_if 'apt-key list | grep HashiCorp'
|
|
|
|
end
|
|
|
|
|
|
|
|
# Retrieve the Ubuntu code:
|
|
|
|
DIST = run_command('lsb_release -cs').stdout.chomp
|
|
|
|
|
|
|
|
# Deploy the `apt` sources:
|
|
|
|
template '/etc/apt/sources.list.d/hashicorp.list' do
|
|
|
|
action :create
|
|
|
|
variables(distribution: DIST)
|
|
|
|
end
|
|
|
|
|
2022-08-11 03:21:34 +00:00
|
|
|
execute 'apt update' do
|
|
|
|
not_if 'which vault'
|
|
|
|
end
|
2021-06-21 12:27:04 +00:00
|
|
|
|
|
|
|
package 'vault'
|