Install `consul`, when finding a newer version.
This commit is contained in:
parent
32ede88fbb
commit
e0820892d4
|
@ -2,6 +2,7 @@
|
||||||
# Calculating the latest `consul` version:
|
# Calculating the latest `consul` version:
|
||||||
# -------------------------------------------
|
# -------------------------------------------
|
||||||
download_url = ''
|
download_url = ''
|
||||||
|
tag_version = ''
|
||||||
|
|
||||||
begin
|
begin
|
||||||
require 'net/http'
|
require 'net/http'
|
||||||
|
@ -26,6 +27,9 @@ end
|
||||||
# Main Part
|
# Main Part
|
||||||
# -------------------------------------------
|
# -------------------------------------------
|
||||||
|
|
||||||
|
# バージョン確認して、アップデート必要かどうか確認
|
||||||
|
result = run_command("consul version | grep #{tag_version}", error: false)
|
||||||
|
if result.exit_status != 0
|
||||||
# Download:
|
# Download:
|
||||||
execute "wget #{download_url} -O #{node['consul']['tmp_path']}"
|
execute "wget #{download_url} -O #{node['consul']['tmp_path']}"
|
||||||
|
|
||||||
|
@ -45,3 +49,5 @@ link '/usr/local/bin/consul' do
|
||||||
user 'root'
|
user 'root'
|
||||||
to '/opt/consul/bin/consul'
|
to '/opt/consul/bin/consul'
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue