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:03.41
  • Play
    Get MAC addresses for interfaces that are up
  • Task
    Method 3 - Use command to get interface info on Linux
  • Host
    kvm1-chi

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.005768
end
2025-07-22 10:35:19.064113
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:19.058345
stderr

stderr_lines
[]
stdout
eno3,34:80:0d:44:4b:c2
eno4,34:80:0d:44:4b:c3
stdout_lines
[
    "eno3,34:80:0d:44:4b:c2",
    "eno4,34:80:0d:44:4b:c3"
]