2020-11-22 07:00:00 +00:00
|
|
|
# Install `Consul`:
|
|
|
|
KEYSRV = "https://apt.releases.hashicorp.com/gpg"
|
|
|
|
ID = "A3219F7B"
|
2019-03-03 08:50:49 +00:00
|
|
|
|
2020-11-22 07:00:00 +00:00
|
|
|
execute "apt-key adv --keyserver #{KEYSRV} --recv-keys #{ID}" do
|
2020-11-22 08:25:09 +00:00
|
|
|
not_if 'apt-key list | grep HashiCorp'
|
2019-03-03 08:50:49 +00:00
|
|
|
end
|
|
|
|
|
2020-11-22 07:00:00 +00:00
|
|
|
# Retrieve the Ubuntu code:
|
|
|
|
DIST = run_command('lsb_release -cs').stdout.chomp
|
2019-03-03 08:50:49 +00:00
|
|
|
|
2020-11-22 07:00:00 +00:00
|
|
|
# Deploy the `apt` sources:
|
|
|
|
template '/etc/apt/sources.list.d/consul.list' do
|
|
|
|
action :create
|
|
|
|
variables(distribution: DIST)
|
2019-03-03 08:50:49 +00:00
|
|
|
end
|
2019-11-05 15:37:15 +00:00
|
|
|
|
2020-11-22 07:00:00 +00:00
|
|
|
execute 'apt update'
|
|
|
|
|
|
|
|
package 'consul'
|