Set pipefail for shell commands that use pipes
We should enforce the use of pipefail
for shell cmds that use pipes.
See the helmfile resource in ansible/roles/apps/tasks/cert-manager.yml
.
See also the ansible-lint ShellWithoutPipefail rule
❯ grep shell -ir ansible/roles | grep \|
ansible/roles/configure_helmfile/tasks/main.yml: shell: helmfile --version | cut -d' ' -f 3 | tr -d 'v'
ansible/roles/rke_configuration/tasks/main.yml: shell: rke --version | cut -d' ' -f 3 | tr -d 'v'
ansible/roles/apps/tasks/helmfiles.yml: shell: /usr/local/bin/helmfile -b /snap/bin/helm -e oas -f {{ data_directory }}/source/helmfiles/helmfile.d/{{ item }}.yaml apply --suppress-secrets | sed 's/\x1B\[[0-9;]*[JKmsu]//g' >> {{ log_directory }}/helmfile.log
ansible/roles/apps/tasks/init.yml: shell: 'helm ls --failed --short | xargs -L1 helm delete --purge'
ansible/roles/apps/tasks/cert-manager.yml: shell: |
ansible/roles/setup/tasks/krew.yml: shell: kubectl krew version | grep GitTag | sed 's/^.*v//'