pvc-ansible/roles/pvc/tasks/keydb/main.yml

55 lines
1.1 KiB
YAML
Raw Normal View History

---
- name: remove redis packages via apt
apt:
name:
- redis
- redis-server
- redis-tools
state: absent
purge: yes
- name: install keydb packages via apt
apt:
name:
- keydb
state: latest
update-cache: yes
register: apt_res
retries: 5
until: apt_res is success
- name: install keydb configuration file
template:
src: keydb/keydb.conf.j2
dest: /etc/keydb/keydb.conf
owner: keydb
group: keydb
mode: 0640
notify: restart keydb
2024-03-07 13:34:23 -05:00
- name: create keydb unit override directory
file:
state: directory
dest: /etc/systemd/system/keydb-server.service.d
2024-03-07 13:21:10 -05:00
- name: install keydb unit override file
template:
src: keydb/override.conf.j2
dest: /etc/systemd/system/keydb-server.service.d/override.conf
register: systemd
- name: reload systemd to apply changes
command: systemctl daemon-reload
when: systemd.changed
- name: start but disable services (managed by PVC)
service:
name: "{{ item }}"
state: started
enabled: no
ignore_errors: yes
with_items:
- keydb-server
- meta: flush_handlers