40 lines
1.0 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
2022-09-04 14:00:17 +02:00
- name: Install consul-template unit
template: src=consul-template-consul.service.j2 dest=/etc/systemd/system/consul-template-consul.service
register: consul_template_tpl_unit
notify: restart consul-template-consul
tags: consul
2022-07-21 01:00:17 +02:00
- name: Reload systemd
systemd: daemon_reload=True
2022-09-04 14:00:17 +02:00
when: consul_unit.changed or consul_template_tpl_unit.changed
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: |
d /run/nomad 770 root {{ consul_user }}
dest: /etc/tmpfiles.d/consul.conf
notify: systemd-tmpfiles
register: consul_tmpfiles
tags: consul
- name: Create tmpfiles
command: systemd-tmpfiles --create
when: consul_tmpfiles.changed
tags: consul