infra/ansible/roles/consul_server/tasks/Debian.yml

19 lines
487 B
YAML
Raw Normal View History

2020-08-20 04:02:35 +00:00
---
2020-08-20 05:11:33 +00:00
- 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
2020-08-20 04:02:35 +00:00
- name: get consul
unarchive:
src: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_linux_amd64.zip"
dest: /usr/local/bin/
2020-08-20 05:11:33 +00:00
mode: 0755
owner: root
group: root
2020-08-20 04:02:35 +00:00
remote_src: yes
2020-08-20 05:11:33 +00:00
when: installed_consul_version.stdout != consul_version