Skip to content

Commit

Permalink
add redis config
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiKhomik committed Dec 9, 2024
1 parent c32a5d6 commit f4a224d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions ansible1/playbook-develop-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
roles:
# - packages
- postgresql
- redis
5 changes: 5 additions & 0 deletions ansible1/roles/redis/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: Restart Redis
service:
name: redis-server
state: restarted
32 changes: 32 additions & 0 deletions ansible1/roles/redis/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
- name: Update apt-get repo and cache
apt:
update_cache: yes

- name: Install redis
apt:
name: redis-server
state: present

- name: Update redis configuration
lineinfile:
path: /etc/redis/redis.conf
regexp: "^protected-mode"
line: "protected-mode no"
state: present
backup: yes

- name: Bind default address
lineinfile:
path: /etc/redis/redis.conf
regexp: "^bind"
line: "bind 0.0.0.0 ::1"
state: present
backup: yes
notify: Restart redis

- name: Start redis
service:
name: redis-server
state: started
enabled: yes

0 comments on commit f4a224d

Please sign in to comment.