ansible-collections / arista.eos

Ansible Network Collection for Arista EOS
GNU General Public License v3.0
82 stars 70 forks source link

eos_command fails to run commands on ansible 2.12 #335

Open tuxonfire opened 2 years ago

tuxonfire commented 2 years ago
SUMMARY

eos_command fails to run commands on ansible 2.12

ISSUE TYPE
COMPONENT NAME

eos_command

ANSIBLE VERSION
ansible-playbook [core 2.12.1]
  config file = /runner/project/ansible.cfg
  configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.8/site-packages/ansible
  ansible collection location = /runner/requirements_collections:/home/runner/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible-playbook
  python version = 3.8.8 (default, Aug 11 2021, 06:52:42) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
  jinja version = 2.10.1
  libyaml = True
COLLECTION VERSION
arista.eos.eos_command 4.1.1
CONFIGURATION
ansible-config dump --only-changed
OS / ENVIRONMENT

Arista devices

STEPS TO REPRODUCE

When running a task with eos_command, which contains the following lines fail on Ansible 2.12:

- name: RUNNING SHOW COMMANDS FOR CHECKS ON ARISTA DEVICES
  eos_command:
      retries: 30
      commands:
        - show clock
        - show users
        - dir
        - diff running-config startup-config
        - show running-config
        - show version
        - show extensions detail
        - show boot-extensions
        - show inventory
        - show system coredump
        - show configuration checkpoints
        - show schedule summary
        - bash ls -lh /mnt/flash/schedule/tech-support
        - show lldp neighbors
        - show isis neighbors
        - show ip interface brief
        - show ipv6 interface brief
        - show interface status
        - show port-channel summary
        - show spanning-tree
        - show mlag config-sanity
        - show mlag detail
        - show mlag interfaces
        - show vlan
        - show vlan internal allocation policy
        - show vlan internal usage
        - show vrf
        - show mac-address-table count
        - show mac-address-table | exclude Po1000|Router
        - show ip arp vrf all summary
        - show ip arp vrf all | exclude Port-Channel1000
        - show ipv6 neighbors vrf all summary
        - show ipv6 neighbors vrf all | exclude Port-Channel1000
        - show ip bgp summary vrf all
        - show ipv6 bgp summary vrf all
        - show ip route vrf all summary
        - show ipv6 route vrf all summary
        - show ip route vrf all connected
        - show ipv6 route vrf all connected
        - show ip route vrf all static
        - show ipv6 route vrf all static
        - show ip route vrf all isis
        - show ipv6 route vrf all isis
        - show ip route vrf all bgp
        - show ipv6 route vrf all bgp
        - show ip route vrf all 0.0.0.0/0 detail
        - show ipv6 route vrf all ::/0 detail
        - show bgp evpn summary
        - show bgp evpn | wc -l
        - show logging | exclude debugging
        - show clock
  register: output
EXPECTED RESULTS

Run the playbook with success, on Ansible version 2.9 the same playbook is running properly against the devices.

ACTUAL RESULTS
 EXEC /bin/sh -c 'rm -f -r /home/runner/.ansible/tmp/ansible-local-20cybnai5o/ansible-tmp-1648050770.4559352-281-100225841577522/ > /dev/null 2>&1 && sleep 0'
  The full traceback is:
    File "/tmp/ansible_eos_command_payload_uzk56hcp/ansible_eos_command_payload.zip/ansible_collections/arista/eos/plugins/module_utils/network/eos/eos.py", line 153, in run_commands
      response = connection.run_commands(
    File "/tmp/ansible_eos_command_payload_uzk56hcp/ansible_eos_command_payload.zip/ansible/module_utils/connection.py", line 200, in __rpc__
      raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)
  fatal: [hostmachine]: FAILED! => {
      "changed": false,
      "invocation": {
          "module_args": {
              "commands": [
                  "show clock",
                  "show users",
                  "dir",
                  "diff running-config startup-config",
                  "show running-config",
                  "show version",
                  "show extensions detail",
                  "show boot-extensions",
                  "show inventory",
                  "show system coredump",
                  "show configuration checkpoints",
                  "show schedule summary",
                  "bash ls -lh /mnt/flash/schedule/tech-support",
                  "show lldp neighbors",
                  "show isis neighbors",
                  "show ip interface brief",
                  "show ipv6 interface brief",
                  "show interface status",
                  "show port-channel summary",
                  "show spanning-tree",
                  "show mlag config-sanity",
                  "show mlag detail",
                  "show mlag interfaces",
                  "show vlan",
                  "show vlan internal allocation policy",
                  "show vlan internal usage",
                  "show vrf",
                  "show mac-address-table count",
                  "show mac-address-table | exclude Po1000|Router",
                  "show ip arp vrf all summary",
                  "show ip arp vrf all | exclude Port-Channel1000",
                  "show ipv6 neighbors vrf all summary",
                  "show ipv6 neighbors vrf all | exclude Port-Channel1000",
                  "show ip bgp summary vrf all",
                  "show ipv6 bgp summary vrf all",
                  "show ip route vrf all summary",
                  "show ipv6 route vrf all summary",
                  "show ip route vrf all connected",
                  "show ipv6 route vrf all connected",
                  "show ip route vrf all static",
                  "show ipv6 route vrf all static",
                  "show ip route vrf all isis",
                  "show ipv6 route vrf all isis",
                  "show ip route vrf all bgp",
                  "show ipv6 route vrf all bgp",
                  "show ip route vrf all 0.0.0.0/0 detail",
                  "show ipv6 route vrf all ::/0 detail",
                  "show bgp evpn summary",
                  "show bgp evpn | wc -l",
                  "show logging | exclude debugging",
                  "show clock"
              ],
              "interval": 1,
              "match": "all",
              "provider": null,
              "retries": 30,
              "wait_for": null
          },
          "msg": "conf /etc/dhcp/dhcpd.conf; sudo systemctl restart dhcpd echo    #!/bin/bash    if (systemctl -q is-active dhcpd.service) then  echo "Application is still running.\\"\   exit 1    else    "
}
thomas-rotszyld commented 2 years ago

Same problem here

GomathiselviS commented 2 years ago

@tuxonfire I am trying to reproduce the issue locally. But I am unable to. I am using eos - 4.24.6M with the same ansible and eos versions as yours. I have a feeling that a particular command from the list is causing this issue. Can you check that, if possible? If not can you provide the running-config on your device? Isolating the command which is causing this failure will be very helpful.