ansible/roles/redis/tasks/main.yml

31 lines
750 B
YAML

#!/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
mode: "2755"
owner: redis
group: redis
notify: restart redis
- name: Start service
service:
name: redis-server
state: started
enabled: yes
become: yes