Skip to content

Commit

Permalink
try alternative redis install
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech committed Jul 25, 2024
1 parent 841b7d1 commit fa778cf
Showing 1 changed file with 32 additions and 10 deletions.
42 changes: 32 additions & 10 deletions roles/redis/tasks/redis.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
---
- name: Add Redis PPA
ansible.builtin.apt_repository:
repo: "ppa:redislabs/redis"
state: present

- name: Remove existing Redis keyring file

Check failure on line 3 in roles/redis/tasks/redis.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (file).
file:
path: /usr/share/keyrings/redis-archive-keyring.gpg
state: absent
become: true

- name: Update apt cache
ansible.builtin.apt:
update_cache: yes
- name: Add Redis GPG Key

Check failure on line 9 in roles/redis/tasks/redis.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

command-instead-of-module

curl used in place of get_url or uri module

Check failure on line 9 in roles/redis/tasks/redis.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (shell).

Check failure on line 9 in roles/redis/tasks/redis.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

risky-shell-pipe

Shells that use pipes should set the pipefail option.
shell: curl -fsSL https://packages.redis.io/gpg | sudo gpg --batch --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
become: true

- name: Install specific Redis version
ansible.builtin.apt:
name: "redis-server=7.2*"
- name: Add Redis APT Repository

Check failure on line 13 in roles/redis/tasks/redis.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (shell).

Check failure on line 13 in roles/redis/tasks/redis.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

risky-shell-pipe

Shells that use pipes should set the pipefail option.
shell: echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
become: true

- name: Install redis

Check failure on line 17 in roles/redis/tasks/redis.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (apt).
apt:
name: redis={{version}}

Check warning on line 19 in roles/redis/tasks/redis.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: redis={{version}} -> redis={{ version }}
state: present
update_cache: yes
become: true

#- name: Add Redis PPA
# ansible.builtin.apt_repository:
# repo: "ppa:redislabs/redis"
# state: present
# become: true
#
#- 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
# become: true

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

0 comments on commit fa778cf

Please sign in to comment.