2024-04-06 08:24:01 +00:00
|
|
|
# apt source:
|
|
|
|
SRC = 'https://apt.releases.hashicorp.com/gpg'
|
|
|
|
DEST = '/usr/share/keyrings/hashicorp-archive-keyring.gpg'
|
2021-06-21 12:27:04 +00:00
|
|
|
|
2024-04-06 08:24:01 +00:00
|
|
|
execute "wget -O- #{SRC} | gpg --dearmor -o #{DEST}" do
|
|
|
|
not_if "test -e #{DEST}"
|
2021-06-21 12:27:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Retrieve the Ubuntu code:
|
2024-04-28 03:12:18 +00:00
|
|
|
DIST = run_command('lsb_release -cs 2>/dev/null').stdout.chomp
|
2021-06-21 12:27:04 +00:00
|
|
|
|
|
|
|
# Deploy the `apt` sources:
|
|
|
|
template '/etc/apt/sources.list.d/hashicorp.list' do
|
|
|
|
action :create
|
|
|
|
variables(distribution: DIST)
|
2024-06-10 02:55:04 +00:00
|
|
|
|
|
|
|
owner 'root'
|
|
|
|
group 'root'
|
2021-06-21 12:27:04 +00:00
|
|
|
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'
|