NewsBlur-viq/ansible/roles/consul/tasks/main.yml
2021-02-24 14:40:43 -05:00

35 lines
872 B
YAML

---
- name: Add the HashiCorp GPG key
become: yes
apt_key:
url: https://apt.releases.hashicorp.com/gpg
state: present
- name: Add the official HashiCorp Linux repository.
become: yes
apt_repository:
repo: "deb [arch=amd64] https://apt.releases.hashicorp.com {{ ansible_distribution_release }} main"
when: ansible_distribution_version != '14.04'
- name: Installing Consul
become: yes
apt:
pkg: consul
state: latest
when: ansible_distribution_version != '14.04'
- name: Register Manager IP
run_once: yes
become: no
register: consul_manager_ip
local_action: command /srv/newsblur/ansible/roles/consul/tasks/get_consul_manager_ip.py
- name: Found consul manager IP
debug:
msg: "IP is {{ consul_manager_ip.stdout }}"
- name: Ensure /etc/consul.d exists
become: yes
file:
path: /etc/consul.d
state: directory