From 88a84945285dbd6dee40d4b04ed781585d467478 Mon Sep 17 00:00:00 2001 From: Carrol Cox Date: Mon, 14 Oct 2019 18:06:12 +0500 Subject: [PATCH] [FIX] linting * add pipefail for shell module * set bash instead sh for shell module --- tasks/docker-compose-install.yml | 5 ++++- tasks/docker-shim.yml | 3 +++ tasks/lazydocker-install.yml | 5 ++++- tasks/setup-Debian.yml | 3 ++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tasks/docker-compose-install.yml b/tasks/docker-compose-install.yml index 4f6299b..a535fa9 100644 --- a/tasks/docker-compose-install.yml +++ b/tasks/docker-compose-install.yml @@ -7,7 +7,10 @@ - name: docker-compose | get current binary version shell: | + set -o pipefail sudo -Hu nobody timeout 2 {{ docker_compose_path }} --version 2>&1 | grep -Eoi '([0-9]{1,}\.){1,3}[0-9]{1,}(|-[a-z0-9]{1,})' | sort -uV | head -1 + args: + executable: /bin/bash register: docker_compose_current_version changed_when: false when: @@ -21,4 +24,4 @@ owner: root mode: 0755 when: - - not docker_compose_current_binary.stat.exists or (docker_compose_current_version.stdout and docker_compose_current_version.stdout is version(docker_compose_version, '!=')) + - not docker_compose_current_binary.stat.exists or docker_compose_current_version.stdout is version(docker_compose_version, '!=') diff --git a/tasks/docker-shim.yml b/tasks/docker-shim.yml index 1dff997..c644d7d 100644 --- a/tasks/docker-shim.yml +++ b/tasks/docker-shim.yml @@ -1,7 +1,10 @@ --- - name: docker-shim | get current version when installed shell: | + set -o pipefail sudo -Hu nobody timeout 2 docker --version 2>&1 | grep -Eoi '([0-9]{1,}\.){2,3}[0-9]{1,}(|-[a-z0-9]{1,})' | sort -uV | head -1 + args: + executable: /bin/bash register: docker_current_version changed_when: false diff --git a/tasks/lazydocker-install.yml b/tasks/lazydocker-install.yml index 78176dd..873d475 100644 --- a/tasks/lazydocker-install.yml +++ b/tasks/lazydocker-install.yml @@ -7,7 +7,10 @@ - name: lazydocker | get current binary version shell: | + set -o pipefail sudo -Hu nobody timeout 2 {{ lazydocker_path }} --version 2>&1 | grep -Eoi '([0-9]{1,}\.){1,3}[0-9]{1,}(|-[a-z0-9]{1,})' | sort -uV | head -1 + args: + executable: /bin/bash register: lazydocker_current_version changed_when: false when: @@ -25,4 +28,4 @@ owner: root mode: 0755 when: - - not lazydocker_current_binary.stat.exists or (lazydocker_current_version.stdout and lazydocker_current_version.stdout is version(lazydocker_version, '!=')) + - not lazydocker_current_binary.stat.exists or lazydocker_current_version.stdout is version(lazydocker_version, '!=') diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index 5d4e148..faebaed 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -38,10 +38,11 @@ - name: Add Docker apt key (alternative for older systems without SNI). shell: | - set -euxo pipefail + set -o pipefail curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - args: warn: false + executable: /bin/bash when: - add_repository_key is failed