Skip to content

junos_install_config causes Ansible to incorrectly report failure when warnings exist #58

@cvicente

Description

@cvicente

Ansible output (redacted):

TASK: [Deploy configuration] **************************************************
failed: [router.example.net] => {"changed": false, "failed": true, "file": "/mypath/config.xml"}
msg: Unable to make changes

FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/Users/myuser/deploy.retry

router.example.net : ok=4    changed=0    unreachable=0    failed=1

Netconf log file in router.example.net shows:

Mar 10 14:43:06 [37567] Outgoing: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/13.2X51/junos" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:c5c2a4ee-c733-11e4-8b93-3c15c2d90eda">
Mar 10 14:43:06 [37567] Outgoing: <commit-results>
Mar 10 14:43:12 [37567] Outgoing: <rpc-error>
Mar 10 14:43:12 [37567] Outgoing: <error-type>application</error-type>
Mar 10 14:43:12 [37567] Outgoing: <error-tag>invalid-value</error-tag>
Mar 10 14:43:12 [37567] Outgoing: <error-severity>warning</error-severity>
Mar 10 14:43:12 [37567] Outgoing: <error-path>[edit routing-instances BACKNET protocols]</error-path>
Mar 10 14:43:12 [37567] Outgoing: <error-message>mgd: requires 'bgp' license</error-message>
Mar 10 14:43:12 [37567] Outgoing: <error-info>
Mar 10 14:43:12 [37567] Outgoing: <bad-element>bgp</bad-element>
Mar 10 14:43:12 [37567] Outgoing: </error-info>
Mar 10 14:43:12 [37567] Outgoing: </rpc-error>
Mar 10 14:43:49 [37567] Outgoing: <routing-engine junos:style="normal">
Mar 10 14:43:49 [37567] Outgoing: <name>fpc0</name>
Mar 10 14:43:49 [37567] Outgoing: <commit-check-success/>
Mar 10 14:44:14 [37567] Outgoing: <commit-success/>
Mar 10 14:44:16 [37567] Outgoing: </routing-engine>
Mar 10 14:44:16 [37567] Outgoing: </commit-results>
Mar 10 14:44:16 [37567] Outgoing: <ok/>
Mar 10 14:44:16 [37567] Outgoing: </rpc-reply>
Mar 10 14:44:16 [37567] Outgoing: ]]>]]>
Mar 10 14:44:16 [37567] Incoming: <?xml version="1.0" encoding="UTF-8"?><nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:e98608d7-c733-11e4-bc64-3c15c2d90eda"><nc:close-session/></nc:rpc>]]>]]>
Mar 10 14:44:16 [37567] Outgoing: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/13.2X51/junos" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:e98608d7-c733-11e4-bc64-3c15c2d90eda">
Mar 10 14:44:16 [37567] Outgoing: <ok/>
Mar 10 14:44:16 [37567] Outgoing: </rpc-reply>

We are working on the license thing, but the configuration is actually committed, so Ansible incorrectly reports that changes could not be made.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions