Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icx_config does not backup the running config #260

Open
sjwk opened this issue Apr 27, 2021 · 4 comments
Open

icx_config does not backup the running config #260

sjwk opened this issue Apr 27, 2021 · 4 comments
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)

Comments

@sjwk
Copy link

sjwk commented Apr 27, 2021

SUMMARY

icx_config doesn't appear to backup the config as documented. Running a task to backup the config should save the file and return a variable saying where and what the file was. Instead it saves nothing and returns the running config as a string inside a variable named backup

ISSUE TYPE
  • Bug Report
COMPONENT NAME

icx_config

ANSIBLE VERSION
ansible 2.10.8
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/keble/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]

CONFIGURATION
ANSIBLE_NOCOWS(/etc/ansible/ansible.cfg) = True
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = ['/etc/ansible/hosts']
DEFAULT_REMOTE_USER(/etc/ansible/ansible.cfg) = ansdeploy
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = auto

OS / ENVIRONMENT

Ubuntu 18.04
Ruckus ICX 7150 running v08.0.95bcT211

STEPS TO REPRODUCE

Run the below playbook against a Ruckus ICX switch

- hosts: switch
  vars:
    ansible_connection: ansible.netcommon.network_cli
    ansible_network_os: community.network.icx
    ansible_user: ...
    ansible_password:  ...
    ansible_become: yes
    ansible_become_method: enable
    ansible_become_password: ...
  tasks:
    - name: Save Ruckus config
      community.network.icx_config:
        backup: yes
EXPECTED RESULTS

According to documentation, it should save the backup file into the root of the playbook or role directory. It also should return 'backup_path' as a variable to show where it had saved the backup.

ACTUAL RESULTS

As far as I can tell, it's not saving the backup file anywhere. It also doesn't return a backup path, but instead returns the entire config from the switch as a string in a variable named 'backup'.

[WARNING]: packaging Python module unavailable; unable to validate collection
Ansible version requirements

PLAY [switch] ******************************************************************

TASK [Gathering Facts] *********************************************************
ok: [it.switch.hbac]

TASK [Save Ruckus config] ******************************************************
ok: [it.switch.hbac]

PLAY RECAP *********************************************************************
it.switch.hbac             : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

@egroeper
Copy link

Same with voss_config. Seems related.

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) labels Nov 10, 2021
@ansibullbot
Copy link
Collaborator

@amosolson
Copy link

I'm having the exact same issue as @sjwk using icx_config. The backup operation claims to run successfully, but the backup file is never created and the entire running config text is returned in a variable called "backup".

@EdificomSA
Copy link
Contributor

EdificomSA commented Jan 31, 2023

#113
May be related ?

From commscope-ruckus/RUCKUS_ICX_Ansible#45 (comment) :

Browsing the Ansible codebase, it looks like the following ActionModule is supposed to save the backup variable to disk and create the backup_path variable:
network.py
I'd guess either this ActionModule isn't being invoked, or the icx_config module is failing the conditions at line 98:

if (
  config_module
  and self._task.args.get("backup")
  and not result.get("failed")
):
  self._handle_backup_option(result, task_vars)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)
Projects
None yet
Development

No branches or pull requests

5 participants