From d92944c345d8b3429a0aeaa068c2bd0be5eb25e3 Mon Sep 17 00:00:00 2001 From: Sandwich Date: Thu, 31 Oct 2024 00:43:49 +0100 Subject: [PATCH] Fix riski shell pipe --- roles/configuration/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/configuration/tasks/main.yml b/roles/configuration/tasks/main.yml index ebbcc82..40cd108 100644 --- a/roles/configuration/tasks/main.yml +++ b/roles/configuration/tasks/main.yml @@ -205,7 +205,7 @@ register: net_inf - name: Register MAC Address of the Network Interface - ansible.builtin.shell: ip link show "{{ net_inf.stdout }}" | awk '/link\/ether/ {print $2}' | tr '[:lower:]' '[:upper:]' + ansible.builtin.shell: set -o pipefail && ip link show "{{ net_inf.stdout }}" | awk '/link\/ether/ {print $2}' | tr '[:lower:]' '[:upper:]' register: net_mac changed_when: net_mac.rc == 0