45 lines
1.1 KiB
YAML
Raw Normal View History

2022-07-21 01:00:17 +02:00
---
- name: Deploy systemd service unit
template: src=consul.service.j2 dest=/etc/systemd/system/consul.service
register: consul_unit
notify: restart consul
tags: consul
2023-07-05 19:00:07 +02:00
- name: Deploy consul service wrapper
template: src=consul.sh.j2 dest={{ consul_root_dir }}/bin/consul mode=755
notify: restart consul
2022-07-21 01:00:17 +02:00
tags: consul
2022-07-23 14:00:15 +02:00
- name: Install backup hooks
template: src={{ item }}-backup.j2 dest=/etc/backup/{{ item }}.d/consul mode=755
loop:
- pre
- post
tags: consul
2023-07-03 15:00:09 +02:00
- name: Create tmpfiles fragment
copy:
content: |
2023-07-05 19:00:07 +02:00
d /run/consul 770 root {{ consul_user }}
2023-07-03 15:00:09 +02:00
dest: /etc/tmpfiles.d/consul.conf
register: consul_tmpfiles
tags: consul
- name: Create tmpfiles
command: systemd-tmpfiles --create
when: consul_tmpfiles.changed
tags: consul
2023-07-05 19:00:07 +02:00
- name: Install vault agent unit file
template: src=vault/agent.service.j2 dest=/etc/systemd/system/consul-vault-agent.service
register: consul_vault_agent_unit
notify: restart consul-vault-agent
tags: consul
- name: Reload systemd
systemd: daemon_reload=True
when: consul_unit.changed or consul_vault_agent_unit.changed
tags: consul