Use `eget` to download and install `consul-template`.
This commit is contained in:
parent
4f2aeaac41
commit
6bc876df6f
|
@ -1,10 +1,12 @@
|
|||
# -------------------------------------------
|
||||
# Specifying the default settings:
|
||||
# -------------------------------------------
|
||||
|
||||
|
||||
node.reverse_merge!({
|
||||
'consulTemplate' => {
|
||||
'baseUrl' => 'https://releases.hashicorp.com/consul-template/',
|
||||
'version' => '0.25.2',
|
||||
'version' => `curl -s https://releases.hashicorp.com/consul-template/ | htmlq -t 'a' | grep consul-template | head -n 1 | sed -e 's/^[^_]*_//g'`.chomp!,
|
||||
'zipPrefix' => 'consul-template_',
|
||||
'zipPostfix' => '_linux_amd64.zip',
|
||||
'storage' => '/opt/consul-template/consul-template',
|
||||
|
|
|
@ -5,20 +5,13 @@ consulTemplate_url = "#{node['consulTemplate']['baseUrl']}#{node['consulTemplate
|
|||
result = run_command('which consul-template', error: false)
|
||||
if result.exit_status != 0
|
||||
|
||||
# Download:
|
||||
TMP = "/tmp/#{consulTemplate_zip}"
|
||||
|
||||
execute "wget #{consulTemplate_url} -O #{TMP}"
|
||||
|
||||
directory '/opt/consul-template' do
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0755'
|
||||
end
|
||||
|
||||
execute "unzip #{TMP} -d /opt/consul-template/" do
|
||||
not_if 'test -e /opt/consul-template/consul-template'
|
||||
end
|
||||
execute "eget #{consulTemplate_url} --to /opt/consul-template/"
|
||||
|
||||
# Change Owner and Permissions:
|
||||
file "#{node['consulTemplate']['storage']}" do
|
||||
|
|
Loading…
Reference in New Issue