-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathredis.yaml
More file actions
31 lines (27 loc) · 789 Bytes
/
redis.yaml
File metadata and controls
31 lines (27 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- name: configure redis db
hosts: redis
become: yes
tasks:
- name: disable redis module
ansible.builtin.command: dnf module disable redis -y
- name: enable redis:7 module
ansible.builtin.command: dnf module enable redis:7 -y
- name: install redis
ansible.builtin.dnf:
name: redis
state: present
- name: Update listen address from 127.0.0.1 to 0.0.0.0
ansible.builtin.replace:
path: /etc/redis/redis.conf
regexp: '127.0.0.1'
replace: '0.0.0.0'
- name: disable protected mode
ansible.builtin.lineinfile:
path: /etc/redis/redis.conf
regexp: 'protected-mode'
line: protected-mode no
- name: start and enable service
ansible.builtin.service:
name: redis
state: started
enabled: yes