19 lines
487 B
YAML
19 lines
487 B
YAML
---
|
|
- name: check consul version
|
|
shell:
|
|
cmd: "consul --version | head -1 | cut -d'v' -f2"
|
|
args:
|
|
executable: /bin/bash
|
|
changed_when: False
|
|
register: installed_consul_version
|
|
|
|
- name: get consul
|
|
unarchive:
|
|
src: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_linux_amd64.zip"
|
|
dest: /usr/local/bin/
|
|
mode: 0755
|
|
owner: root
|
|
group: root
|
|
remote_src: yes
|
|
when: installed_consul_version.stdout != consul_version
|