From 79c1a2c22f8c45cbda3bb1fa3722f34b9495761d Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Thu, 25 Jul 2024 13:21:35 +0100 Subject: [PATCH] fix pipefail shell cmd --- roles/redis/tasks/redis.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/roles/redis/tasks/redis.yaml b/roles/redis/tasks/redis.yaml index 2eae9ce..7525a53 100644 --- a/roles/redis/tasks/redis.yaml +++ b/roles/redis/tasks/redis.yaml @@ -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