From 21ec247569afa1e396c87610c5f18d2dbb56400c Mon Sep 17 00:00:00 2001 From: Jose Date: Sun, 25 Jan 2026 08:23:32 +0100 Subject: [PATCH] =?UTF-8?q?feat=20=E2=9C=A8:=20Add=20support=20for=20start?= =?UTF-8?q?ing=20tcpdump=20with=20'become:=20true'=20in=20wakeonlan=20modu?= =?UTF-8?q?le?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit introduces the functionality to start tcpdump using elevated privileges by setting 'become: true' in the wakeonlan module. This enhancement ensures that tcpdump can capture network traffic even when run as a non-root user. --- tasks/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 6271774..cc0c0a5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -117,14 +117,15 @@ - name: Start tcpdump to capture WOL packet + become: true ansible.builtin.shell: | - timeout 10 tcpdump -i {{ en_interfaces[0] }} -nn -c 1 udp port {{ wol_port }} + tcpdump -i {{ en_interfaces[0] }} -nn -c 1 udp port {{ wol_port }} register: tcpdump_result async: 12 poll: 0 - name: Send Wake-on-LAN packet from localhost - ansible.builtin.wakeonlan: + community.general.wakeonlan: mac: "{{ wol_mac_addresses[0] }}" port: "{{ wol_port }}" broadcast: 255.255.255.255