47 lines
1.0 KiB
YAML
Raw Normal View History

2023-07-03 15:00:09 +02:00
---
- name: Install needed tools
package:
name: "{{ consul_packages }}"
tags: consul
2023-07-08 16:00:11 +02:00
# Migrate from the oldconsul role
2023-07-03 15:00:09 +02:00
- name: Check if consul is a link
2023-07-08 16:00:11 +02:00
stat: path=/usr/local/bin/consul
2023-07-03 15:00:09 +02:00
register: consul_link
tags: vault
- when: consul_link.stat.islnk is defined and consul_link.stat.islnk
block:
- name: Remove consul link
file: path=/usr/local/bin/consul state=absent
- set_fact: consul_install_mode='upgrade'
tags: vault
- when: consul_install_mode != 'none'
block:
- name: Download consul
get_url:
url: "{{ consul_archive_url }}"
dest: /tmp
checksum: sha256:{{ consul_archive_sha256 }}
- name: Extract the archive
unarchive:
src: "/tmp/consul_{{ consul_version }}_linux_amd64.zip"
dest: /usr/local/bin
include: consul
mode: 755
remote_src: True
tags: consul
- name: Install bash completion support
copy:
content: |
2023-07-08 16:00:11 +02:00
complete -C /usr/local/bin/consul consul
2023-07-03 15:00:09 +02:00
dest: /etc/bash_completion.d/consul
mode: 0644
tags: consul