0

I have a playbook I am writing that automates the install of firmware to our fleet of C2960Xs.

I recently moved the location of the Ansible server I am using from my homelab to a VM in Azure. We have security rules on our sites to only allow remote connection on a specific non-default port. After reading, I discovered that means I need to use libssh and not paramiko for remote commands.

I have a specific task I am running, and when running it returns:

fatal: [HOSTNAME]: FAILED! => { "msg": "The conditional check 'ansible_net_filesystems_info['flash:'].spacefree_kb > firmware_image_size' failed. The error was: error while evaluating conditional (ansible_net_filesystems_info['flash:'].spacefree_kb > firmware_image_size): 'ansible_net_filesystems_info' is undefined" }

I then compared the 'before' and 'after' for what facts are being stored at the beginning of the playbook. I found that using Paramiko, I seem to have a TON more detail compared to the facts being gathered via libssh.

One of which being the variable ansible_net_filesystems_info that my playbook references.

Is there a workaround for this process? The idea being to verify there is free space on the switch before moving an archive to the switch for unzipping.

Moridn
  • 35
  • 6
  • FYI, those switches lose software support in a year (10/31/2023): "_The last date that Cisco Engineering may release any final software maintenance releases or bug fixes. After this date, Cisco Engineering will no longer develop, repair, maintain, or test the product software._" You may want to start the replacement process immediately. – Ron Maupin Sep 30 '22 at 22:39
  • If you can have it perform a `dir flash:` command, the last line of the result is like `256503808 bytes total (160374784 bytes free)`. – Ron Maupin Sep 30 '22 at 22:44
  • We are in the process of evaluating replacement switches. That wont be up to me though. How would I parse that? Still very new to Ansible, learning as I go. – Moridn Sep 30 '22 at 22:46
  • I only mention the replacement because all the vendors have a 12-month lead-time on new equipment orders. You have only 13 months before the software will no longer be updated. The hardware could still be fixed for a few years if you have a contract, but any bug fixes or new requirements for the software will not be available. I do not build our playbooks, but I believe the guys that do use Python to parse such output. – Ron Maupin Sep 30 '22 at 22:54
  • Again, not up to me. I am not management. They are informed, vendors are being evaluated, thats not my responsibility or problem. I managed to figure it out. Under the cisco.ios.ios_facts documentation, you can specify the types of facts you want to pull. I added the line: >gather_subset: all – Moridn Sep 30 '22 at 23:02

1 Answers1

0

Under the cisco.ios.ios_facts documentation, you can specify the types of facts you want to pull. I added the line: >gather_subset: all

Moridn
  • 35
  • 6