我正在尝试创建一个剧本来将一些边缘路由器更新到当前的修补程序,但我找不到使用支持的 community.network.edgeos_command 模块参数(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 版本:
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
组件/集合版本:
community.network.edgeos_command 模块
# /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
主机配置:
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:
剧本:
- 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"
结果:
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
我只是想找到一种方法来回答提示的是非问题,我见过用于此的提示模块,但我不能将其用于 edgeos 命令。有什么建议吗?