ansible-role-mastodon/tasks/bare/redis.yml

45 lines
1.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

- name: "Start and enable redis service"
become: true
#Workaround for "Interactive authentication required" issue
become_user: root
service: "name={{ item }} state=started enabled=yes"
with_items:
- redis
- name: Set Redis password for RHEL8 system
become: true
lineinfile:
dest: "/etc/redis.conf"
regexp: "ˆrequirepass"
line: "requirepass {{ redis_pass }}"
state: present
when:
- ansible_os_family == "RedHat"
- ansible_facts['distribution_major_version'] == "8"
- name: Set Redis password for RHEL9 system
become: true
lineinfile:
dest: "/etc/redis/redis.conf"
regexp: "ˆrequirepass"
line: "requirepass {{ redis_pass }}"
state: present
when:
- ansible_os_family == "RedHat"
- ansible_facts['distribution_major_version'] == "9"
- name: Set Redis password for Debian system
become: true
lineinfile:
dest: "/etc/redis/redis.conf"
regexp: "ˆrequirepass"
line: "requirepass {{ redis_pass }}"
state: present
when:
- ansible_os_family == "Debian"
- name: Restart Redis
become: true
#Workaround for "Interactive authentication required" issue
become_user: root
service: name=redis state=restarted