From 89e41597a6774af250bbc1d69fb409d4965920ad Mon Sep 17 00:00:00 2001 From: Hao Liu Date: Thu, 23 Feb 2023 10:46:48 -0500 Subject: [PATCH] switch from head to tail from @relrod `head` will close the input fd when it no longer needs it (or exits). find will try to write to the closed fd and somewhere along the way, it will receive SIGPIPE as a result. This is why `yes | head -5 ` doesn't run forever. --- awx/playbooks/project_update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/playbooks/project_update.yml b/awx/playbooks/project_update.yml index 7334547f97..125b5ef312 100644 --- a/awx/playbooks/project_update.yml +++ b/awx/playbooks/project_update.yml @@ -26,7 +26,7 @@ name: Update source tree if necessary tasks: - name: Delete project directory before update - ansible.builtin.shell: set -o pipefail && find . -delete -print | head -2 # volume mounted, cannot delete folder itself + ansible.builtin.shell: set -o pipefail && find . -delete -print | tail -2 # volume mounted, cannot delete folder itself register: reg changed_when: reg.stdout_lines | length > 1 args: