From 932b192c49bf7e15ad8b58637cfe941f15b16292 Mon Sep 17 00:00:00 2001 From: Bert Van Vreckem Date: Sun, 23 Jun 2019 14:24:04 +0200 Subject: [PATCH] Fix ansible-lint warning by setting pipefail in shell: tasks --- tasks/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 27ae8bc..f83dd1e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -22,7 +22,9 @@ tags: samba - name: Register Samba version - shell: "smbd --version | sed 's/Version //'" + shell: > + set -o nounset -o pipefail -o errexit && + smbd --version | sed 's/Version //' register: samba_version changed_when: false tags: samba @@ -144,6 +146,7 @@ - name: Create Samba users if they don't exist yet shell: > + set -o nounset -o pipefail -o errexit && (pdbedit --user={{ item.name }} 2>&1 > /dev/null) \ || (echo {{ item.password }}; echo {{ item.password }}) \ | smbpasswd -s -a {{ item.name }}