From 841b7d1e291a88495e36203cd120c45b3fef46f3 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Thu, 25 Jul 2024 11:27:06 +0100 Subject: [PATCH] fix redis install ansible --- roles/redis/tasks/redis.yaml | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/roles/redis/tasks/redis.yaml b/roles/redis/tasks/redis.yaml index af31c10..5bc9b1e 100644 --- a/roles/redis/tasks/redis.yaml +++ b/roles/redis/tasks/redis.yaml @@ -1,26 +1,26 @@ --- -- name: Install Redis +- name: Add Redis PPA + ansible.builtin.apt_repository: + repo: "ppa:redislabs/redis" + state: present become: true - tasks: - - name: Add Redis PPA - ansible.builtin.apt_repository: - repo: "ppa:redislabs/redis" - state: present - - name: Update apt cache - ansible.builtin.apt: - update_cache: yes +- name: Update apt cache + ansible.builtin.apt: + update_cache: yes + become: true - - name: Install specific Redis version - ansible.builtin.apt: - name: "redis-server=7.2*" - state: present +- name: Install specific Redis version + ansible.builtin.apt: + name: "redis-server=7.2*" + state: present + become: true - - name: Ensure Redis is started - service: name=redis-server state=started enabled=yes - sudo: true +- name: Ensure Redis is started + service: name=redis-server state=started enabled=yes + become: true - - name: Ensure Redis Configuration - template: src=templates/redis.conf.j2 dest=/etc/redis/redis.conf owner=root group=root mode=0644 - sudo: true - notify: Restart services redis +- 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