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

netconf_config: Always stacktraces on using backup: yes (i.e. example cannot ever work) #56022

Closed
eikef opened this issue May 2, 2019 · 3 comments · Fixed by #56138
Closed
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. module This issue/PR relates to a module. networking Network category pycon_sprints Items that will be worked on during PyCon sprints support:network This issue/PR relates to code supported by the Ansible Network Team. traceback This issue/PR includes a traceback.

Comments

@eikef
Copy link
Contributor

eikef commented May 2, 2019

SUMMARY

The backup parameter for netconf_config cannot ever work if set to yes. This is due to the code in the netconf_config module throwing a stacktrace whenever it is set. The module_utils/netconf/netconf.py provides a get_config method, but it requires an additional parameter of "filter", which is not set in netconf_config when trying to obtain the current configuration for backup purposes.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

netconf_config

ANSIBLE VERSION

ansible 2.8.0rc1.post0

STEPS TO REPRODUCE

Minimal example playbook:

- name: save config
  netconf_config:
    backup: yes

(note that this is a minimalized version of the last example shipped with the documentation of the netconf_config module).

EXPECTED RESULTS

Backup of NETCONF configuration is saved somewhere.

ACTUAL RESULTS
TASK [switch : save config] ************************************************************************************************************************************
task path: /home/XXX/roles/switch/tasks/main.yml:29
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: get_config() takes at least 3 arguments (3 given)
fatal: [switch01]: FAILED! => changed=false
  module_stderr: |-
    Traceback (most recent call last):
      File "/home/XXX/.ansible/tmp/ansible-local-68072FPzspT/ansible-tmp-1556809036.71-228316506197860/AnsiballZ_netconf_config.py", line 114, in <module>
        _ansiballz_main()
      File "/home/XXX/.ansible/tmp/ansible-local-68072FPzspT/ansible-tmp-1556809036.71-228316506197860/AnsiballZ_netconf_config.py", line 106, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/XXX/.ansible/tmp/ansible-local-68072FPzspT/ansible-tmp-1556809036.71-228316506197860/AnsiballZ_netconf_config.py", line 49, in invoke_module
        imp.load_module('__main__', mod, module, MOD_DESC)
      File "/tmp/ansible_netconf_config_payload_VY5Wfu/__main__.py", line 439, in <module>
      File "/tmp/ansible_netconf_config_payload_VY5Wfu/__main__.py", line 367, in main
    TypeError: get_config() takes at least 3 arguments (3 given)
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1
@ansibot
Copy link
Contributor

ansibot commented May 2, 2019

Files identified in the description:

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

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented May 2, 2019

@ansibot
Copy link
Contributor

ansibot commented May 2, 2019

@eikef, just so you are aware we have a dedicated Working Group for network.
You can find other people interested in this in #ansible-network on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. networking Network category support:network This issue/PR relates to code supported by the Ansible Network Team. traceback This issue/PR includes a traceback. labels May 2, 2019
@ganeshrn ganeshrn added the pycon_sprints Items that will be worked on during PyCon sprints label May 5, 2019
@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label May 5, 2019
wjohnston888 added a commit to wjohnston888/ansible that referenced this issue May 6, 2019
Associated with ansible#56022

tests backup through netconf only using one parameter.
wjohnston888 added a commit to wjohnston888/ansible that referenced this issue May 6, 2019
wjohnston888 added a commit to wjohnston888/ansible that referenced this issue May 6, 2019
StephenSorriaux pushed a commit to StephenSorriaux/ansible that referenced this issue May 6, 2019
* Fixes Netconf_config single parameter bug
Fixes 56022

fixed get_config to not require multiple parameters to just run a backup

* Add Integration test for netconf_config
Associated with ansible#56022

tests backup through netconf only using one parameter.

* Added debug to the begin and end of file

* Fix formatting of save config.  ansible#56022

* removed blank line at end: ansible#56022
ganeshrn pushed a commit to ganeshrn/ansible that referenced this issue May 7, 2019
* Fixes Netconf_config single parameter bug
Fixes 56022

fixed get_config to not require multiple parameters to just run a backup

* Add Integration test for netconf_config
Associated with ansible#56022

tests backup through netconf only using one parameter.

* Added debug to the begin and end of file

* Fix formatting of save config.  ansible#56022

* removed blank line at end: ansible#56022

(cherry picked from commit 647ed20)
abadger pushed a commit that referenced this issue May 22, 2019
* Fixes Netconf_config single parameter bug (#56138)

* Fixes Netconf_config single parameter bug
Fixes 56022

fixed get_config to not require multiple parameters to just run a backup

* Add Integration test for netconf_config
Associated with #56022

tests backup through netconf only using one parameter.

* Added debug to the begin and end of file

* Fix formatting of save config.  #56022

* removed blank line at end: #56022

(cherry picked from commit 647ed20)

* Fix netconf_config backup string issue (#56175)

*  Convert the ElementTree object to string
   before dumping the configuration in file.

(cherry picked from commit 9c5745a)
ganeshrn pushed a commit to ganeshrn/ansible that referenced this issue Jun 19, 2019
* Fixes Netconf_config single parameter bug
Fixes 56022

fixed get_config to not require multiple parameters to just run a backup

* Add Integration test for netconf_config
Associated with ansible#56022

tests backup through netconf only using one parameter.

* Added debug to the begin and end of file

* Fix formatting of save config.  ansible#56022

* removed blank line at end: ansible#56022

(cherry picked from commit 647ed20)
@ansible ansible locked and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. module This issue/PR relates to a module. networking Network category pycon_sprints Items that will be worked on during PyCon sprints support:network This issue/PR relates to code supported by the Ansible Network Team. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants