2019-09-05 06:44:38 +02:00
|
|
|
---
|
|
|
|
|
2024-01-18 10:00:38 +01:00
|
|
|
- name: "Add begin marker if missing"
|
|
|
|
ansible.builtin.lineinfile:
|
|
|
|
path: "{{ redis_conf_dir }}/redis.conf"
|
|
|
|
line: "# BEGIN {{ redis_conf_marker_label }}"
|
|
|
|
insertbefore: BOF
|
|
|
|
create: yes
|
|
|
|
tags:
|
|
|
|
- redis
|
|
|
|
|
|
|
|
- name: "Add end marker if missing"
|
|
|
|
ansible.builtin.lineinfile:
|
|
|
|
path: "{{ redis_conf_dir }}/redis.conf"
|
|
|
|
line: "# END {{ redis_conf_marker_label }}"
|
|
|
|
insertbefore: "Generated by CONFIG REWRITE"
|
|
|
|
create: yes
|
|
|
|
tags:
|
|
|
|
- redis
|
|
|
|
|
|
|
|
- name: "Create config if missing"
|
|
|
|
ansible.builtin.blockinfile:
|
|
|
|
path: "{{ redis_conf_dir }}/redis.conf"
|
|
|
|
marker: "# {mark} {{ redis_conf_marker_label }}"
|
|
|
|
block: "{{ lookup('ansible.builtin.template', '../templates/redis.conf.j2') }}"
|
2019-09-05 09:41:58 +02:00
|
|
|
mode: "0640"
|
|
|
|
owner: redis
|
|
|
|
group: redis
|
2024-01-18 10:00:38 +01:00
|
|
|
create: yes
|
2019-09-05 06:44:38 +02:00
|
|
|
notify: "{{ redis_restart_handler_name }}"
|
|
|
|
tags:
|
|
|
|
- redis
|
|
|
|
|
2022-08-17 16:53:05 +02:00
|
|
|
- name: Config directory permissions are set
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.file:
|
2022-08-17 16:53:05 +02:00
|
|
|
dest: "{{ redis_conf_dir }}"
|
|
|
|
mode: "0750"
|
|
|
|
owner: redis
|
|
|
|
group: redis
|
|
|
|
tags:
|
|
|
|
- redis
|
|
|
|
|
2019-09-05 06:44:38 +02:00
|
|
|
- name: Redis is running and enabled on boot.
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.systemd:
|
2019-09-05 06:44:38 +02:00
|
|
|
name: "{{ redis_systemd_name }}"
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
tags:
|
|
|
|
- redis
|