Skip to content

Commit

Permalink
fix pipefail shell cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech committed Jul 25, 2024
1 parent 9d18aba commit 79c1a2c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions roles/redis/tasks/redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
become: true

- name: Add Redis GPG Key
ansible.builtin.shell: |
# See: https://ansible.readthedocs.io/projects/lint/rules/risky-shell-pipe/#correct-code
set -o pipefail
curl -fsSL https://packages.redis.io/gpg | sudo gpg --batch --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
ansible.builtin.shell:
cmd: |
set -o pipefail # See: https://ansible.readthedocs.io/projects/lint/rules/risky-shell-pipe/#correct-code
curl -fsSL https://packages.redis.io/gpg | sudo gpg --batch --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
executable: /bin/bash
become: true

- name: Add Redis APT Repository
ansible.builtin.shell: |
# See: https://ansible.readthedocs.io/projects/lint/rules/risky-shell-pipe/#correct-code
set -o pipefail
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
ansible.builtin.shell:
cmd: |
set -o pipefail # See: https://ansible.readthedocs.io/projects/lint/rules/risky-shell-pipe/#correct-code
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
executable: /bin/bash
become: true

- name: Ensure Redis data directory exists
Expand Down

0 comments on commit 79c1a2c

Please sign in to comment.