0

I'm trying to run a playbook with to upgrade the latest firmware on a few edge routers on my network:

- name: Update External ERX with latest firmware
  hosts: externaledgerouters
  remote_user: BudAdmin
  tasks:
   - name: Update ERX Firmware
     become: true
     shell: "add system image https://dl.ui.com/firmwares/edgemax/v2.0.9-hotfix.4/ER-e50.v2.0.9-hotfix.4.5521907.tar"

Whenever I run this on a test target, I get the following error message on the task:

fatal: [ADM-TEST]: FAILED! => {"changed": true, "cmd": "add system image https://dl.ui.com/firmwares/edgemax/v2.0.9-hotfix.4/ER-e50.v2.0.9-hotfix.4.5521907.tar", "delta": "0:00:00.017078", "end": "2022-09-22 12:26:50.331550", "msg": "non-zero return code", "rc": 127, "start": "2022-09-22 12:26:50.314472", "stderr": "/bin/sh: add: command not found", "stderr_lines": ["/bin/sh: add: command not found"], "stdout": "", "stdout_lines": []}

I run the command directly on the edge router and it works, so I'm not sure what I'm missing here. Thanks in advance.

Brian Lamb
  • 41
  • 3
  • 2
    Is `add` a binary or a shell command? You may need to provide the full path to the binary or specify another shell to use. – Gerald Schneider Sep 22 '22 at 12:48
  • You could try using the [edgeos ansible modules](https://docs.ansible.com/ansible/latest/collections/community/network/edgeos_command_module.html). – Gerald Schneider Sep 22 '22 at 12:53
  • That helped, thank you -- but I have some other issues running the playbook now, I'll post another question – Brian Lamb Sep 22 '22 at 20:14
  • It could be helpful to others to have an answer WHICH of these suggestions helped. – Gerald Schneider Sep 23 '22 at 06:07
  • add is not binary nor shell so I needed to use the edgeos_ansible_module as you noted -- it is important to know that ansible core and python should be updated to the latest versions the edgeos module can be installed with "ansible-galaxy collection install community.network" I was able to use the "add" and "show" commands in my playbook using "community.network.edgeos_command:" followed by "commands:" thanks again for the guidance – Brian Lamb Sep 23 '22 at 14:53

0 Answers0