community.network icon indicating copy to clipboard operation
community.network copied to clipboard

slxos_config unable to save configuration

Open Noc7 opened this issue 2 years ago • 2 comments

SUMMARY

When trying to write the configuration on a SLX9640, it fails with the following message:

% ansible-playbook -i inventory/inventory -u XXX -k playbooks/slx_wr.yml -l XXX
SSH password:

PLAY [slx] ***************************************************************************************************************************************************

TASK [save the running config unconditionally] ***************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: See the timeout setting options in the Network Debug and Troubleshooting Guide.
fatal: [XXX]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/Users/xxx/.ansible/tmp/ansible-local-36617u_7ihkbh/ansible-tmp-1642762121.865495-36620-19882093940858/AnsiballZ_slxos_config.py\", line 100, in <module>\n    _ansiballz_main()\n  File \"/Users/xxx/.ansible/tmp/ansible-local-36617u_7ihkbh/ansible-tmp-1642762121.865495-36620-19882093940858/AnsiballZ_slxos_config.py\", line 92, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/Users/xxx/.ansible/tmp/ansible-local-36617u_7ihkbh/ansible-tmp-1642762121.865495-36620-19882093940858/AnsiballZ_slxos_config.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.community.network.plugins.modules.slxos_config', init_globals=dict(_module_fqn='ansible_collections.community.network.plugins.modules.slxos_config', _modlib_path=modlib_path),\n  File \"/opt/homebrew/Cellar/[email protected]/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py\", line 209, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/opt/homebrew/Cellar/[email protected]/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py\", line 96, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/opt/homebrew/Cellar/[email protected]/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py\", line 86, in _run_code\n    exec(code, run_globals)\n  File \"/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_m182nvfl/ansible_community.network.slxos_config_payload.zip/ansible_collections/community/network/plugins/modules/slxos_config.py\", line 461, in <module>\n  File \"/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_m182nvfl/ansible_community.network.slxos_config_payload.zip/ansible_collections/community/network/plugins/modules/slxos_config.py\", line 402, in main\n  File \"/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_m182nvfl/ansible_community.network.slxos_config_payload.zip/ansible_collections/community/network/plugins/modules/slxos_config.py\", line 295, in save_config\n  File \"/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_m182nvfl/ansible_community.network.slxos_config_payload.zip/ansible_collections/community/network/plugins/module_utils/network/slxos/slxos.py\", line 102, in run_commands\n  File \"/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_m182nvfl/ansible_community.network.slxos_config_payload.zip/ansible/module_utils/connection.py\", line 200, in __rpc__\nansible.module_utils.connection.ConnectionError: command timeout triggered, timeout value is 30 secs.\nSee the timeout setting options in the Network Debug and Troubleshooting Guide.\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

PLAY RECAP ***************************************************************************************************************************************************
XXX.   : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
ISSUE TYPE
  • Bug Report
COMPONENT NAME

plugins/modules/network/slxos/slxos_config.py

ANSIBLE VERSION
ansible [core 2.11.6]
  config file = /Users/xxx/ansible/ansible.cfg
  configured module search path = ['/Users/xxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/homebrew/Cellar/ansible/4.8.0/libexec/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/xxx/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin/ansible
  python version = 3.10.0 (default, Oct 12 2021, 22:37:59) [Clang 13.0.0 (clang-1300.0.29.3)]
  jinja version = 3.0.2
  libyaml = True
COLLECTION VERSION
Collection        Version
----------------- -------
community.network 3.0.0
CONFIGURATION
DEFAULT_FORKS(/Users/xxx/ansible/ansible.cfg) = 20
DEFAULT_HOST_LIST(/Users/xxx/ansible/ansible.cfg) = ['/Users/xxx/ansible/inventory/inventory']
DEFAULT_TIMEOUT(/Users/xxx/ansible/ansible.cfg) = 10
HOST_KEY_CHECKING(/Users/xxx/ansible/ansible.cfg) = False
OS / ENVIRONMENT
SLX-OS Operating System Version: 20.3.4
Copyright (c) 1995-2022 Extreme Networks, Inc.
Firmware name:      20.3.4
Build Time:         11:50:16 Dec 15, 2021
Install Time:       08:13:47 Jan 20, 2022
Kernel:             4.14.67
Control Processor:  Intel(R) Xeon(R) CPU D-1527 @ 2.20GHz,  4 cores
Microcode Version:  0x7000017
Memory Size:        System Total: 31653 MB
System Uptime:      1days 2hrs 33mins 8secs

Name     Primary/Secondary Versions
------------------------------------------
SLX-OS   20.3.4
         20.3.4
STEPS TO REPRODUCE

ansible-playbook -i inventory/inventory -u xxx -k playbooks/slx_wr.yml

---
- hosts: slx
  gather_facts: no

  tasks:
    - name: save the running config unconditionally
      community.network.slxos_config:
        save_when: always
EXPECTED RESULTS

Saving the configuration.

ACTUAL RESULTS

The configuration was not saved. It took 30s until the task stops with an error. The reason is that slxos_config.py expects a different text from the CLI. slxos_config.py:293 "prompt": "This operation will modify your startup configuration. Do you want to continue", "answer": "y"} On SLX-OS 20.3.4 the text reads: "This operation will back up the current configuration. Do you want to continue? [y/n]:" The same text is seen on SLX-OS 20.1.x, 20.2.x and 20.3.x as far as I know.

ansible-playbook -i inventory/inventory -u xxx -k playbooks/slx_wr.yml -vvvv
ansible-playbook [core 2.11.6]
  config file = /Users/xxx/ansible/ansible.cfg
  configured module search path = ['/Users/xxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/homebrew/Cellar/ansible/4.8.0/libexec/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/xxx/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin/ansible-playbook
  python version = 3.10.0 (default, Oct 12 2021, 22:37:59) [Clang 13.0.0 (clang-1300.0.29.3)]
  jinja version = 3.0.2
  libyaml = True
Using /Users/xxx/ansible/ansible.cfg as config file
SSH password:
setting up inventory plugins
host_list declined parsing /Users/xxx/ansible/inventory/inventory_core as it did not pass its verify_file() method
script declined parsing /Users/xxx/ansible/inventory/inventory_core as it did not pass its verify_file() method
auto declined parsing /Users/xxx/ansible/inventory/inventory_core as it did not pass its verify_file() method
Parsed /Users/xxx/ansible/inventory/inventory_core inventory source with ini plugin
Loading collection community.network from /opt/homebrew/Cellar/ansible/4.8.0/libexec/lib/python3.10/site-packages/ansible_collections/community/network
Loading callback plugin default of type stdout, v2.0 from /opt/homebrew/Cellar/ansible/4.8.0/libexec/lib/python3.10/site-packages/ansible/plugins/callback/default.py
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: slx_wr.yml *****************************************************************************************************************************************
Positional arguments: playbooks/slx_wr.yml
verbosity: 4
ask_pass: True
remote_user: xxx
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/Users/xxx/ansible/inventory/inventory_core',)
subset: XXX
forks: 20
1 plays in playbooks/slx_wr.yml

PLAY [slx] ***************************************************************************************************************************************************
META: ran handlers

TASK [save the running config unconditionally] ***************************************************************************************************************
task path: /Users/xxx/ansible/playbooks/slx_wr.yml:6
redirecting (type: connection) ansible.builtin.network_cli to ansible.netcommon.network_cli
Loading collection ansible.netcommon from /Users/xxx/.ansible/collections/ansible_collections/ansible/netcommon
redirecting (type: terminal) ansible.builtin.slxos to community.network.slxos
redirecting (type: cliconf) ansible.builtin.slxos to community.network.slxos
<xxx> attempting to start connection
<xxx> using connection plugin ansible.netcommon.network_cli
Found ansible-connection at path /opt/homebrew/bin/ansible-connection
<xxx> local domain socket does not exist, starting it
<xxx> control socket path is /Users/xxx/.ansible/pc/fda2f68759
<xxx> redirecting (type: connection) ansible.builtin.network_cli to ansible.netcommon.network_cli
<xxx> Loading collection ansible.netcommon from /Users/xxx/.ansible/collections/ansible_collections/ansible/netcommon
<xxx> redirecting (type: terminal) ansible.builtin.slxos to community.network.slxos
<xxx> Loading collection community.network from /opt/homebrew/Cellar/ansible/4.8.0/libexec/lib/python3.10/site-packages/ansible_collections/community/network
<xxx> redirecting (type: cliconf) ansible.builtin.slxos to community.network.slxos
<xxx> local domain socket listeners started successfully
<xxx> loaded cliconf plugin ansible_collections.community.network.plugins.cliconf.slxos from path /opt/homebrew/Cellar/ansible/4.8.0/libexec/lib/python3.10/site-packages/ansible_collections/community/network/plugins/cliconf/slxos.py for network_os slxos
<xxx> ssh type is set to paramiko
<xxx>
<xxx> local domain socket path is /Users/xxx/.ansible/pc/fda2f68759
<xxx> Using network group action community.network.slxos for community.network.slxos_config
<xxx> ANSIBLE_NETWORK_IMPORT_MODULES: disabled
<xxx> ANSIBLE_NETWORK_IMPORT_MODULES: module execution time may be extended
<xxx> ESTABLISH LOCAL CONNECTION FOR USER: xxx
<xxx> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /Users/xxxx/.ansible/tmp/ansible-local-36744s7c2jag2 `"&& mkdir "` echo /Users/xxx/.ansible/tmp/ansible-local-36744s7c2jag2/ansible-tmp-1642764873.889224-36747-56274197009268 `" && echo ansible-tmp-1642764873.889224-36747-56274197009268="` echo /Users/xxx/.ansible/tmp/ansible-local-36744s7c2jag2/ansible-tmp-1642764873.889224-36747-56274197009268 `" ) && sleep 0'
Using module file /opt/homebrew/Cellar/ansible/4.8.0/libexec/lib/python3.10/site-packages/ansible_collections/community/network/plugins/modules/slxos_config.py
<xxx> PUT /Users/xxx/.ansible/tmp/ansible-local-36744s7c2jag2/tmpcpw5snj4 TO /Users/xxx/.ansible/tmp/ansible-local-36744s7c2jag2/ansible-tmp-1642764873.889224-36747-56274197009268/AnsiballZ_slxos_config.py
<xxx> EXEC /bin/sh -c 'chmod u+x /Users/xxx/.ansible/tmp/ansible-local-36744s7c2jag2/ansible-tmp-1642764873.889224-36747-56274197009268/ /Users/xxx/.ansible/tmp/ansible-local-36744s7c2jag2/ansible-tmp-1642764873.889224-36747-56274197009268/AnsiballZ_slxos_config.py && sleep 0'
<xxx> EXEC /bin/sh -c '/opt/homebrew/Cellar/ansible/4.8.0/libexec/bin/python3.10 /Users/xxx/.ansible/tmp/ansible-local-36744s7c2jag2/ansible-tmp-1642764873.889224-36747-56274197009268/AnsiballZ_slxos_config.py && sleep 0'
<xxx> EXEC /bin/sh -c 'rm -f -r /Users/xxx/.ansible/tmp/ansible-local-36744s7c2jag2/ansible-tmp-1642764873.889224-36747-56274197009268/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/Users/xxx/.ansible/tmp/ansible-local-36744s7c2jag2/ansible-tmp-1642764873.889224-36747-56274197009268/AnsiballZ_slxos_config.py", line 100, in <module>
    _ansiballz_main()
  File "/Users/xxx/.ansible/tmp/ansible-local-36744s7c2jag2/ansible-tmp-1642764873.889224-36747-56274197009268/AnsiballZ_slxos_config.py", line 92, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/Users/xxx/.ansible/tmp/ansible-local-36744s7c2jag2/ansible-tmp-1642764873.889224-36747-56274197009268/AnsiballZ_slxos_config.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible_collections.community.network.plugins.modules.slxos_config', init_globals=dict(_module_fqn='ansible_collections.community.network.plugins.modules.slxos_config', _modlib_path=modlib_path),
  File "/opt/homebrew/Cellar/[email protected]/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 209, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/opt/homebrew/Cellar/[email protected]/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/opt/homebrew/Cellar/[email protected]/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_4ql4p5jx/ansible_community.network.slxos_config_payload.zip/ansible_collections/community/network/plugins/modules/slxos_config.py", line 461, in <module>
  File "/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_4ql4p5jx/ansible_community.network.slxos_config_payload.zip/ansible_collections/community/network/plugins/modules/slxos_config.py", line 402, in main
  File "/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_4ql4p5jx/ansible_community.network.slxos_config_payload.zip/ansible_collections/community/network/plugins/modules/slxos_config.py", line 295, in save_config
  File "/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_4ql4p5jx/ansible_community.network.slxos_config_payload.zip/ansible_collections/community/network/plugins/module_utils/network/slxos/slxos.py", line 102, in run_commands
  File "/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_4ql4p5jx/ansible_community.network.slxos_config_payload.zip/ansible/module_utils/connection.py", line 200, in __rpc__
ansible.module_utils.connection.ConnectionError: command timeout triggered, timeout value is 30 secs.
See the timeout setting options in the Network Debug and Troubleshooting Guide.
fatal: [xxx]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/Users/xxx/.ansible/tmp/ansible-local-36744s7c2jag2/ansible-tmp-1642764873.889224-36747-56274197009268/AnsiballZ_slxos_config.py\", line 100, in <module>\n    _ansiballz_main()\n  File \"/Users/xxx/.ansible/tmp/ansible-local-36744s7c2jag2/ansible-tmp-1642764873.889224-36747-56274197009268/AnsiballZ_slxos_config.py\", line 92, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/Users/xxx/.ansible/tmp/ansible-local-36744s7c2jag2/ansible-tmp-1642764873.889224-36747-56274197009268/AnsiballZ_slxos_config.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.community.network.plugins.modules.slxos_config', init_globals=dict(_module_fqn='ansible_collections.community.network.plugins.modules.slxos_config', _modlib_path=modlib_path),\n  File \"/opt/homebrew/Cellar/[email protected]/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py\", line 209, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/opt/homebrew/Cellar/[email protected]/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py\", line 96, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/opt/homebrew/Cellar/[email protected]/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py\", line 86, in _run_code\n    exec(code, run_globals)\n  File \"/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_4ql4p5jx/ansible_community.network.slxos_config_payload.zip/ansible_collections/community/network/plugins/modules/slxos_config.py\", line 461, in <module>\n  File \"/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_4ql4p5jx/ansible_community.network.slxos_config_payload.zip/ansible_collections/community/network/plugins/modules/slxos_config.py\", line 402, in main\n  File \"/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_4ql4p5jx/ansible_community.network.slxos_config_payload.zip/ansible_collections/community/network/plugins/modules/slxos_config.py\", line 295, in save_config\n  File \"/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_4ql4p5jx/ansible_community.network.slxos_config_payload.zip/ansible_collections/community/network/plugins/module_utils/network/slxos/slxos.py\", line 102, in run_commands\n  File \"/var/folders/3b/6d40b40932g971mcc2g563qc0000gn/T/ansible_community.network.slxos_config_payload_4ql4p5jx/ansible_community.network.slxos_config_payload.zip/ansible/module_utils/connection.py\", line 200, in __rpc__\nansible.module_utils.connection.ConnectionError: command timeout triggered, timeout value is 30 secs.\nSee the timeout setting options in the Network Debug and Troubleshooting Guide.\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

PLAY RECAP ***************************************************************************************************************************************************
XXX   : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Noc7 avatar Jan 21 '22 11:01 Noc7

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot avatar Jan 21 '22 20:01 ansibullbot

cc @LindsayHill @ujwalkomarla click here for bot help

ansibullbot avatar Jan 21 '22 20:01 ansibullbot