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 if config format is xml #23960

Closed
ganeshrn opened this issue Apr 25, 2017 · 1 comment
Closed

junos_config fails if config format is xml #23960

ganeshrn opened this issue Apr 25, 2017 · 1 comment
Assignees
Labels
affects_2.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. module This issue/PR relates to a module. networking Network category

Comments

@ganeshrn
Copy link
Member

ISSUE TYPE
  • Bug Report
COMPONENT NAME

junos_config

ANSIBLE VERSION
2.3
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
STEPS TO REPRODUCE
Create a file with junos config in xml format
$ cat junos_config.xml
<interfaces>
    <interface>
        <name>ae11</name>
        <unit>
            <name>0</name>
            <description>Test</description>
        </unit>
    </interface>
</interfaces>

-->

  - name: Run junos_config
    junos_config:
      src:  junos_config.xml
      comment: update config
      host: "{{ ansible_ssh_host }}"
      username: "{{ juniper_user }}"
      password: "{{ juniper_passwd }}"
EXPECTED RESULTS

Run should configure interface on device

ACTUAL RESULTS

Fails with error message.

 "msg": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rpc-error xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" xmlns:junos=\"http://xml.juniper.net/junos/15.1X49/junos\" xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n<error-type>protocol</error-type>\n<error-tag>operation-failed</error-tag>\n<error-severity>error</error-severity>\n<error-message>syntax error, expecting &lt;/configuration&gt;</error-message>\n<error-info>\n<bad-element>&lt;interfaces&gt;\n    &lt;interface&gt;\n        &lt;name&gt;ae11&lt;/name&gt;\n        &lt;unit&gt;\n            &lt;name&gt;0&lt;/name&gt;\n            &lt;description&gt;Test&lt;/description&gt;\n        &lt;/unit&gt;\n    &lt;/interface&gt;\n&lt;/interfaces&gt;</bad-element>\n</error-info>\n</rpc-error>\n"
ganeshrn added a commit to ganeshrn/ansible that referenced this issue Apr 25, 2017
If config is in xml format append it to <configuration>
tag as a instance of Element class.
@ansibot
Copy link
Contributor

ansibot commented Apr 25, 2017

@ansibot ansibot added affects_2.3 This issue/PR affects Ansible v2.3 bug_report module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. networking Network category labels Apr 25, 2017
@ganeshrn ganeshrn removed the needs_triage Needs a first human triage before being processed. label Apr 25, 2017
ganeshrn added a commit to ganeshrn/ansible that referenced this issue Apr 25, 2017
If config is in xml format append it to <configuration>
tag as a instance of Element class.
(cherry picked from commit 15c1936)
ganeshrn added a commit that referenced this issue Apr 25, 2017
If config is in xml format append it to <configuration>
tag as a instance of Element class.
(cherry picked from commit 15c1936)
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. module This issue/PR relates to a module. networking Network category
Projects
None yet
Development

No branches or pull requests

3 participants