Score:1

Ansible EdgeOS "add" issue

sl flag

I'm trying to create a playbook to update a few edge routers to current hotfixes, but I cannot find a way to get around the prompted yes/no question with the supported community.network.edgeos_command module parameters (wait_for, interval, commands, retries, match)

add system image https://www.ui.com/download/edgemax/edgerouter-x/default/edgerouter-er-xer-x-sfpep-r6er-10x-firmware-v209-hotfix4
Version [v2.0.9-hotfix.4.5521907.220630.0657] is about to be replaced
Are you sure you want to replace old version? (Yes/No) [Yes]:

Ansible Version:

ansible [core 2.13.4]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/lowkeylamb/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/lowkeylamb/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/lowkeylamb/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/lowkeylamb/.local/bin/ansible
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True

Component/Collection Version:

community.network.edgeos_command module

# /home/lowkeylamb/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
ansible.netcommon 3.1.1
ansible.utils     2.6.1
community.general 5.6.0
community.network 4.0.1

Hosts Config:

externaledgerouters:
 hosts:
  ADM-TEST:
   ansible_host: (public IP)
edgerouters:
 vars:
  ansible_connection: network_cli
  ansible_network_os: edgeos
  ansible_ssh_port: (my ssh port)
  ansible_ssh_pass: (my ssh pw)
 children:
  externaledgerouters:

Playbook:

- name: Update External ERX with latest firmware
  hosts: externaledgerouters
  remote_user: BudAdmin
  tasks:
    - name: Check Image Ver
      community.network.edgeos_command:
       commands: show system image

    - name: Download Hotfix ver2.0.9-hotfix
      community.network.edgeos_command:
       commands: "add system image https://dl.ui.com/firmwares/edgemax/v2.0.9-hotfix.4/ER-e50.v2.0.9-hotfix.4.5521907.tar"

Results:

lowkeylamb@ADM-BRIANLAMB:/etc/ansible/projects/ansible/pi$ ansible-playbook ./playbooks/Ext_ERXfirmware_update.yml -vv
ansible-playbook [core 2.13.4]
  config file = /etc/ansible/projects/ansible/pi/ansible.cfg
  configured module search path = ['/home/lowkeylamb/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/lowkeylamb/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/lowkeylamb/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/lowkeylamb/.local/bin/ansible-playbook
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
Using /etc/ansible/projects/ansible/pi/ansible.cfg as config file
redirecting (type: modules) community.network.edgeos_command to community.network.network.edgeos.edgeos_command
redirecting (type: modules) community.network.edgeos_command to community.network.network.edgeos.edgeos_command
redirecting (type: modules) community.network.edgeos_command to community.network.network.edgeos.edgeos_command
redirecting (type: modules) community.network.edgeos_command to community.network.network.edgeos.edgeos_command
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: Ext_ERXfirmware_update.yml ****************************************************************************************************************************************************************************
1 plays in ./playbooks/Ext_ERXfirmware_update.yml

PLAY [Update External ERX with latest firmware] *****************************************************************************************************************************************************************

TASK [Gathering Facts] ******************************************************************************************************************************************************************************************
task path: /etc/ansible/projects/ansible/pi/playbooks/Ext_ERXfirmware_update.yml:1
redirecting (type: connection) ansible.builtin.network_cli to ansible.netcommon.network_cli
redirecting (type: terminal) ansible.builtin.edgeos to community.network.edgeos
redirecting (type: cliconf) ansible.builtin.edgeos to community.network.edgeos
ok: [ADM-TEST]
META: ran handlers

TASK [Check Image Ver] ******************************************************************************************************************************************************************************************
task path: /etc/ansible/projects/ansible/pi/playbooks/Ext_ERXfirmware_update.yml:5
redirecting (type: connection) ansible.builtin.network_cli to ansible.netcommon.network_cli
redirecting (type: terminal) ansible.builtin.edgeos to community.network.edgeos
redirecting (type: cliconf) ansible.builtin.edgeos to community.network.edgeos
redirecting (type: modules) community.network.edgeos_command to community.network.network.edgeos.edgeos_command
redirecting (type: modules) community.network.edgeos_command to community.network.network.edgeos.edgeos_command
ok: [ADM-TEST] => {"changed": false, "stdout": ["The system currently has the following image(s) installed:\n\nv2.0.9-hotfix.4.5521907.220630.0657-1 (running image) (default boot) \nv2.0.9-hotfix.4.5521907.220630.0657"], "stdout_lines": [["The system currently has the following image(s) installed:", "", "v2.0.9-hotfix.4.5521907.220630.0657-1 (running image) (default boot) ", "v2.0.9-hotfix.4.5521907.220630.0657"]]}

TASK [Download Hotfix ver2.0.9-hotfix] **************************************************************************************************************************************************************************
task path: /etc/ansible/projects/ansible/pi/playbooks/Ext_ERXfirmware_update.yml:9
redirecting (type: connection) ansible.builtin.network_cli to ansible.netcommon.network_cli
redirecting (type: terminal) ansible.builtin.edgeos to community.network.edgeos
redirecting (type: cliconf) ansible.builtin.edgeos to community.network.edgeos
redirecting (type: modules) community.network.edgeos_command to community.network.network.edgeos.edgeos_command
redirecting (type: modules) community.network.edgeos_command to community.network.network.edgeos.edgeos_command
fatal: [ADM-TEST]: FAILED! => {"changed": false, "msg": "command timeout triggered, timeout value is 30 secs.\nSee the timeout setting options in the Network Debug and Troubleshooting Guide."}

PLAY RECAP ******************************************************************************************************************************************************************************************************
ADM-TEST                   : ok=2    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

I'm just trying to find a way to answer that prompted yes/no question, I've seen the prompt module used for this but I can't use that for the edgeos commands. Any suggestions?

pt flag
You may want to open an issue against the [community.network](https://github.com/ansible-collections/community.network) repository that provides the `edgeos` driver.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.