Execution
Date 22 Jul 2025 11:34:37 +0100
Duration 00:00:59.04
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.11
ara 1.7.2 / 1.7.2
Python 3.10.10
Summary
27 Hosts
11 Tasks
297 Results
1 Plays
1 Files
0 Records

Task result details

  • Status
    OK
  • Duration
    00:00:01.35
  • Play
    Get MAC addresses for interfaces that are up
  • Task
    Method 3 - Use command to get interface info on Linux
  • Host
    kvm021

Field Value
changed
False
cmd
ip -o link show | awk '/state UP/ {
  iface = $2; gsub(/:/, "", iface); 
  if (match($0, /link\/ether ([0-9a-f:]+)/)) {
    mac = substr($0, RSTART+11, RLENGTH-11);
    print iface "," mac
  }
}'
delta
0:00:00.006971
end
2025-07-22 10:35:17.681430
failed_when_result
False
invocation
{
    "module_args": {
        "_raw_params": "ip -o link show | awk '/state UP/ {\n  iface = $2; gsub(/:/, \"\", iface); \n  if (match($0, /link\\/ether ([0-9a-f:]+)/)) {\n    mac = substr($0, RSTART+11, RLENGTH-11);\n    print iface \",\" mac\n  }\n}'\n",
        "_uses_shell": true,
        "argv": null,
        "chdir": null,
        "creates": null,
        "executable": null,
        "expand_argument_vars": true,
        "removes": null,
        "stdin": null,
        "stdin_add_newline": true,
        "strip_empty_ends": true
    }
}
msg

rc
0
start
2025-07-22 10:35:17.674459
stderr

stderr_lines
[]
stdout
eno1,a4:bf:01:69:37:0c
enp24s0,68:05:ca:2c:2f:7d
stdout_lines
[
    "eno1,a4:bf:01:69:37:0c",
    "enp24s0,68:05:ca:2c:2f:7d"
]