Skip to content

Commit

Permalink
install redis systemd file
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech committed Jul 25, 2024
1 parent ff1e1f4 commit bb2f6cb
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion roles/redis/tasks/redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,32 @@
update_cache: yes
become: true

- name: Copy the redis systemd service file
become: true
ansible.builtin.copy:
content: |
[Unit]
Description=Redis
After=syslog.target
[Service]
ExecStart=/usr/bin/redis-server /etc/redis/redis.conf
RestartSec=5s
Restart=on-success
[Install]
WantedBy=multi-user.target
dest: /etc/systemd/system/redis.service
owner: root
group: root
mode: "0644"
register: _redis_service

- name: Ensure Redis Configuration
template: src=templates/redis.conf.j2 dest=/etc/redis/redis.conf owner=root group=root mode=0644
become: true
notify: Restart services redis

- name: Ensure Redis is started
service: name=redis-server state=started enabled=yes
service: name=redis state=started enabled=yes
become: true

0 comments on commit bb2f6cb

Please sign in to comment.