2020-04-26 01:22:36 -05:00
|
|
|
#!/usr/bin/ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
---
|
|
|
|
- name: Set up Redis
|
|
|
|
block:
|
|
|
|
- name: Install Redis
|
|
|
|
apt:
|
|
|
|
name: "redis-server"
|
|
|
|
- name: Copy configs
|
|
|
|
template:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
loop:
|
|
|
|
- { src: "redis.conf", dest: "/etc/redis/redis.conf" }
|
|
|
|
- { src: "redis-tmpfiles.conf", dest: "/etc/tmpfiles.d/redis.conf" }
|
|
|
|
notify: restart redis
|
|
|
|
- name: Create socket directory
|
|
|
|
file:
|
|
|
|
path: "/var/run/redis"
|
|
|
|
state: directory
|
2020-07-12 07:52:06 -05:00
|
|
|
mode: "2755"
|
2020-04-26 01:22:36 -05:00
|
|
|
owner: redis
|
|
|
|
group: redis
|
|
|
|
notify: restart redis
|
|
|
|
- name: Start service
|
|
|
|
service:
|
|
|
|
name: redis-server
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
become: yes
|