Output too long for command "display interface" inside a HUAWEI using "community.network.ce_command"

Hi, I’m trying to register the stdout of the command “display interface” inside a HUAWEI using the module “community.network.ce_command”. The task fails because the output is too long. These are the playbook’s task and the error:

TASK

name: Interfaces switch/router HUAWEI
  community.network.ce_command:
    commands: [display interface]
  register: uptime_interfaces_error

ERROR

(The output is much longer but I’ll not write it all)

TASK [Uptime e Interfaces switch/router HUAWEI] ********************************
fatal: [sea_swi_crdcdc201_gwh]: FAILED! => {"changed": false, "msg": "Command: display interface, 100ge1/0/1 current state : down (ifindex: 5), line protocol current state : down, description:, switch port, pvid : 1, tpid : 8100(hex), the maximum frame length is 9216, internet protocol processing : disabled, ip sending frames' format is pktfmt_ethnt_2, hardware address is 1c3d-2f70-2241, port mode: auto, port split/aggregate: -, speed: auto, loopback: none, duplex: full, negotiation: -, input flow-control: disable, output flow-control: disable, mdi: -, fec: -, last physical up time : -, last physical down time : 2022-07-22 11:02:38+02:00 dst, current system time: 2024-02-07 15:21:25+01:00, statistics last cleared:never, last 300 seconds input rate: 0 bits/sec, 0 packets/sec, last 300 seconds output rate: 0 bits/sec, 0 packets/sec, input peak rate 0 bits/sec, record time: -, output peak rate 0 bits/sec, record time: -, input : 0 bytes, 0 packets, output: 0 bytes, 0 packets, input:, unicast: 0, multicast: 0, broadcast: 0, jumbo: 0, discard: 0, frames: 0, pause: 0, total error: 0, crc: 0, giants: 0, jabbers: 0, fragments: 0, runts: 0, dropevents: 0, alignments: 0, symbols: 0, ignoreds: 0, output:, unicast: 0, multicast: 0, broadcast: 0, jumbo: 0, discard: 0, buffers purged: 0, pause: 0, input bandwidth utilization threshold : 90.00%, output bandwidth utilization threshold: 90.00%, last 300 seconds input utility rate: 0.00%, last 300 seconds output utility rate: 0.00%, 100ge1/0/2 current state : down (ifindex: 6), line protocol current state : down, description:, switch port, pvid : 1, tpid : 8100(hex), the maximum frame length is 9216, internet protocol processing : disabled, ip sending frames' format is pktfmt_ethnt_2, hardware address is 1c3d-2f70-2241, port mode: auto, port split/aggregate: -, speed: auto, loopback: none, duplex: full, negotiation: -, input flow-control: disable, output flow-control: disable, mdi: -, fec: -, last physical up time : -, last physical down time : 2022-07-22 11:02:38+02:00 dst, current system time: 2024-02-07 15:21:25+01:00, statistics last cleared:never, last 300 seconds input rate: 0 bits/sec, 0 packets/sec, last 300 seconds output rate: 0 bits/sec, 0 packets/sec, input peak rate 0 bits/sec, record time: -, output peak rate 0 bits/sec, record time: -, input : 0 bytes, 0 packets, output: 0 bytes, 0 packets, input:, unicast: 0, multicast: 0, broadcast: 0, jumbo: 0, discard: 0, frames: 0, pause: 0, total error: 0, crc: 0, giants: 0, jabbers: 0, fragments: 0, runts: 0, dropevents: 0, alignments: 0, symbols: 0, ignoreds: 0, output:, unicast: 0, multicast: 0, broadcast: 0, jumbo: 0, discard: 0, buffers purged: 0, pause...

And here it’s with JSON format:


{
"msg": "Command: display interface, 100ge1/0/1 current state : down (ifindex: 5), line protocol current state : down, description:, switch port, pvid : 1, tpid : 8100(hex), the maximum frame length is 9216, internet protocol processing : disabled, ip sending frames' format is pktfmt_ethnt_2, hardware address is 1c3d-2f70-2241, port mode: auto, port split/aggregate: -, speed: auto, loopback: none, duplex: full, negotiation: -, input flow-control: disable, output flow-control: disable, mdi: -, fec: -, last physical up time : -, last physical down time : 2022-07-22 11:02:38+02:00 dst, current system time: 2024-02-07 15:21:25+01:00, statistics last cleared:never, last 300 seconds input rate: 0 bits/sec, 0 packets/sec, last 300 seconds output rate: 0 bits/sec, 0 packets/sec, input peak rate 0 bits/sec, record time: -, output peak rate 0 bits/sec, record time: -, input : 0 bytes, 0 packets, output: 0 bytes, 0 packets, input:, unicast: 0, multicast: 0, broadcast: 0, jumbo: 0, discard: 0, frames: 0, pause: 0, total error: 0, crc: 0, giants: 0, jabbers: 0, fragments: 0, runts: 0, dropevents: 0, alignments: 0, symbols: 0, ignoreds: 0, output:, unicast: 0, multicast: 0, broadcast: 0, jumbo: 0, discard: 0, buffers purged: 0, pause: 0, input bandwidth utilization threshold : 90.00%, output bandwidth utilization threshold: 90.00%, last 300 seconds input utility rate: 0.00%, last 300 seconds output utility rate: 0.00%, 100ge1/0/2 current state : down (ifindex: 6), line protocol current state : down, description:, switch port, pvid : 1, tpid : 8100(hex), the maximum frame length is 9216, internet protocol processing : disabled, ip sending frames' format is pktfmt_ethnt_2, hardware address is 1c3d-2f70-2241, port mode: auto, port split/aggregate: -, speed: auto, loopback: none, duplex: full, negotiation: -,
"invocation": {
"module_args": {
"commands": [
"display interface"
],
"match": "all",
"retries": 10,
"interval": 1,
"wait_for": null
}
},
"_ansible_no_log": null,
"changed": false
}

Do you know any solution? Because it all works, the “display interface” and all, but it makes the task FAIL

Hi @fravilcas welcome to the Ansible Community Forum,

Let me share a tip on using the forum to make it easier for people to help out:

Code blocks

I just edited your message to include the “code blocks” tags for the playbook section, this makes it easier to read as it keeps the playbook format and spacing.

When composing your next messages, you can select the playbook section of text you copy/pasted and use the </> button in the tool-bar right at the top of the message window where you are typing, this will automatically put it in the box you see in the messages above. Here is a screen capture to show the button location:

image