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

junos_config fails to apply changes to devices with large configurations when source format is "set" #485

Open
roadracer96 opened this issue Jan 2, 2024 · 1 comment
Assignees

Comments

@roadracer96
Copy link

SUMMARY

In this case, the device under test has a configuration of 145758 lines (set), 158600 (stanza), or 588119 lines (XML). When applying a change using the junos_config module with "lines: list", the following error is presented:

xmlSAX2Characters: huge text node, line 145760, column 1 (, line 145760)

The error is only related to the size of the configuration. There is no problem with the configuration being applied.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

junos_config

ANSIBLE VERSION
denike@sfdc-ansible01:/opt/ansible/ticketplays$ ansible --version
ansible [core 2.13.8]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/MERIT/denike/.ansible/plugins/modules', '/opt/ansible/plugins/modules']
  ansible python module location = /home/MERIT/denike/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/MERIT/denike/.ansible/collections:/opt/ansible/collections
  executable location = /home/MERIT/denike/.local/bin/ansible
  python version = 3.8.10 (default, Nov 22 2023, 10:22:35) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True

COLLECTION VERSION
# /opt/ansible/collections/ansible_collections
Collection            Version
--------------------- -------
junipernetworks.junos 5.0.0  

CONFIGURATION
COLLECTIONS_PATHS(/etc/ansible/ansible.cfg) = ['/home/MERIT/denike/.ansible/collections', '/opt/ansible/collections']
DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 10
DEFAULT_GATHERING(/etc/ansible/ansible.cfg) = explicit
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = ['/opt/ansible/netdevices']
DEFAULT_MODULE_NAME(/etc/ansible/ansible.cfg) = raw
DEFAULT_MODULE_PATH(/etc/ansible/ansible.cfg) = ['/home/MERIT/denike/.ansible/plugins/modules', '/opt/ansible/plugins/modules']
DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = debug
DEPRECATION_WARNINGS(/etc/ansible/ansible.cfg) = False
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = auto_legacy_silent
INVENTORY_ENABLED(/etc/ansible/ansible.cfg) = ['host_list', 'script', 'auto', 'yaml', 'ini', 'toml', 'netbox.netbox.nb_inventory']
PERSISTENT_COMMAND_TIMEOUT(/etc/ansible/ansible.cfg) = 300
RETRY_FILES_ENABLED(/etc/ansible/ansible.cfg) = False

OS / ENVIRONMENT

Ubuntu 22.04

STEPS TO REPRODUCE

Configure a device with a dummy configuration exceeding 146000 lines (exact size to create error is unknown). Run the following playbook

---
- name: Test Config change
  hosts: device
  gather_facts: no
  tasks:
  - name: Test Config change
    junos_config:
      comment: Test Config change
      lines:
        - set policy-options policy-statement TEST term TEST then accept
EXPECTED RESULTS

Change to be applied to device

ACTUAL RESULTS

<1.2.3.4> ANSIBLE_NETWORK_IMPORT_MODULES: found junos_config at /home/MERIT/denike/.ansible/collections/ansible_collections/junipernetworks/junos/plugins/modules/junos_config.py
<1.2.3.4> ANSIBLE_NETWORK_IMPORT_MODULES: running junos_config
<1.2.3.4> ANSIBLE_NETWORK_IMPORT_MODULES: complete
<1.2.3.4> ANSIBLE_NETWORK_IMPORT_MODULES: Result: {'failed': True, '_ansible_parsed': False, 'module_stdout': '', 'module_stderr': 'xmlSAX2Characters: huge text node, line 145760, column 1 (, line 145760)', 'msg': 'MODULE FAILURE\nSee stdout/stderr for the exact error'}
fatal: [chcg-eqx-ch1-c1]: FAILED! => {
"changed": false
}

MSG:

MODULE FAILURE
See stdout/stderr for the exact error

MODULE_STDERR:

xmlSAX2Characters: huge text node, line 145760, column 1 (, line 145760)


@roadracer96
Copy link
Author

Possibly related to this?

ncclient/ncclient#185

@rohitthakur2590 rohitthakur2590 self-assigned this Jan 3, 2024
@rohitthakur2590 rohitthakur2590 added bug This issue/PR relates to a bug. enhancement and removed bug This issue/PR relates to a bug. labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants