ansible / ansible-modules-core

Ansible modules - these modules ship with ansible
1.3k stars 1.95k forks source link

module junos_config with the parameter lines + delete: the delete details doesnt apply #3984

Closed ksator closed 7 years ago

ksator commented 8 years ago
ISSUE TYPE

junos_config https://github.com/ansible/ansible-modules-core/blob/devel/network/junos/junos_config.py http://docs.ansible.com/ansible/junos_config_module.html

ANSIBLE VERSION
ksator@ubuntu:~/ansible-training-for-junos$ ansible --version
ansible 2.1.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
ksator@ubuntu:~/ansible-training-for-junos$ 
CONFIGURATION

default

OS / ENVIRONMENT

$ uname -a Linux ubuntu 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

SUMMARY

can not delete junos configuration lines on junos devices using the module junos_config with the parameter lines + delete (the delete details doesnt apply).

STEPS TO REPRODUCE

I used this playbook https://github.com/ksator/ansible-training-for-junos/blob/master/junos_config/playbook.yml (module junos_config, with the parameter lines, and some lines starting wuth delete). ansible-playbook junos_config/playbook.yml


---
 - name: core module junos_config
   hosts: Chris-EX4200-test
   connection: local
   gather_facts: no

   vars_prompt:
    - name: DEVICE_PASSWORD
      prompt: Device password
      private: yes

   tasks:
   - name: test
     junos_config:
      host: "{{ inventory_hostname }}"
      username: pytraining
      password: "{{ DEVICE_PASSWORD }}"
      lines:
       - delete system name-server 172.30.179.2
       - set system host-name newname
EXPECTED RESULTS

The expected result with module junos_config with the parameter lines with lines starting with delete is: this module should remove these junos lines on remote devices. with the playbook above, this "system name-server 172.30.179.2" should be removed from the junos configuration of the host.

ACTUAL RESULTS

the playbook did not remove "system name-server 172.30.179.2" on the host. however the details of the set command (set system host-name newname) has been added succesfully.

I ran this playbook (https://github.com/ksator/ansible-training-for-junos/blob/master/junos_config/playbook.yml).   with extra verbosity (-vvvv).  
and I enabled netconf log on device (http://www.juniper.net/documentation/en_US/junos14.2/topics/topic-map/netconf-traceoptions.html).   
here's the output log.  

ksator@ubuntu:~/ansible-training-for-junos$ ansible-playbook junos_config/playbook.yml -i hosts -vvvv  
Using /etc/ansible/ansible.cfg as config file
Loaded callback default of type stdout, v2.0

PLAYBOOK: playbook.yml *********************************************************
1 plays in junos_config/playbook.yml
Device password: 

PLAY [core module junos_config] ************************************************

TASK [test] ********************************************************************
task path: /home/ksator/ansible-training-for-junos/junos_config/playbook.yml:13
<172.30.179.113> ESTABLISH LOCAL CONNECTION FOR USER: ksator
<172.30.179.113> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1466153012.52-229272728614829 `" && echo ansible-tmp-1466153012.52-229272728614829="` echo $HOME/.ansible/tmp/ansible-tmp-1466153012.52-229272728614829 `" ) && sleep 0'
<172.30.179.113> PUT /tmp/tmptlRDup TO /home/ksator/.ansible/tmp/ansible-tmp-1466153012.52-229272728614829/junos_config
<172.30.179.113> EXEC /bin/sh -c 'LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python /home/ksator/.ansible/tmp/ansible-tmp-1466153012.52-229272728614829/junos_config; rm -rf "/home/ksator/.ansible/tmp/ansible-tmp-1466153012.52-229272728614829/" > /dev/null 2>&1 && sleep 0'
changed: [172.30.179.113] => {"changed": true, "diff": {"prepared": "\n[edit system]\n-  host-name ex4200-13;\n+  host-name newname;\n"}, "invocation": {"module_args": {"comment": "update config", "confirm": 1, "host": "172.30.179.113", "lines": ["delete system name-server 172.30.179.2", "set system host-name newname"], "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "port": null, "provider": null, "replace": false, "rollback": null, "ssh_keyfile": null, "timeout": 0, "transport": "netconf", "username": "pytraining", "zeroize": false}, "module_name": "junos_config"}}

PLAY RECAP *********************************************************************
172.30.179.113             : ok=1    changed=1    unreachable=0    failed=0   

ksator@ubuntu:~/ansible-training-for-junos$

netconf logs on junos device
pytraining@ex4200-13> show log netconf-ops.log    
Jun 17 10:43:35 Started tracing session: 48789
Jun 17 10:43:35 [48789] Incoming: <?xml version="1.0" encoding="UTF-8"?><nc:hello xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"><nc:capabilities><nc:capability>urn:ietf:params:netconf:capability:writable-running:1.0</nc:capability><nc:capability>urn:ietf:params:netconf:capability:rollback-on-error:1.0</nc:capability><nc:capability>urn:liberouter:params:netconf:capability:power-control:1.0</nc:capability><nc:capability>urn:ietf:params:netconf:capability:validate:1.0</nc:capability><nc:capability>urn:i
Jun 17 10:43:36 [48789] 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:94529d66-3467-11e6-bdb3-000c29432de4"><get-configuration format="set"/></nc:rpc>]]>]]>
Jun 17 10:43:36 [48789] Outgoing: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/14.1X53/junos" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:94529d66-3467-11e6-bdb3-000c29432de4">
Jun 17 10:43:36 [48789] Outgoing: <configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm" junos:changed-seconds="1466152917" junos:changed-localtime="2016-06-17 10:41:57 CEST">
Jun 17 10:43:36 [48789] Outgoing:     <version>14.1X53-D25.2</version>
Jun 17 10:43:36 [48789] Outgoing:     <groups>
Jun 17 10:43:36 [48789] Outgoing:         <name>access</name>
Jun 17 10:43:36 [48789] Outgoing:         <interfaces>
Jun 17 10:43:36 [48789] Outgoing:             <interface>
Jun 17 10:43:36 [48789] Outgoing:                 <name>&lt;ge-*&gt;</name>
Jun 17 10:43:36 [48789] Outgoing:                 <mtu>4484</mtu>
Jun 17 10:43:36 [48789] Outgoing:                 <unit>
Jun 17 10:43:36 [48789] Outgoing:                     <name>0</name>
Jun 17 10:43:36 [48789] Outgoing:                     <family>
Jun 17 10:43:36 [48789] Outgoing:                         <ethernet-switching>
Jun 17 10:43:36 [48789] Outgoing:                             <port-mode>access</port-mode>
Jun 17 10:43:36 [48789] Outgoing:                         </ethernet-switching>
Jun 17 10:43:36 [48789] Outgoing:                     </family>
Jun 17 10:43:36 [48789] Outgoing:                 </unit>
Jun 17 10:43:36 [48789] Outgoing:             </interface>
Jun 17 10:43:36 [48789] Outgoing:             <interface>
Jun 17 10:43:36 [48789] Outgoing:                 <name>&lt;xe-*&gt;</name>
Jun 17 10:43:36 [48789] Outgoing:                 <mtu>4484</mtu>
Jun 17 10:43:36 [48789] Outgoing:                 <unit>
Jun 17 10:43:36 [48789] Outgoing:                     <name>0</name>
Jun 17 10:43:36 [48789] Outgoing:                     <family>
Jun 17 10:43:36 [48789] Outgoing:                         <ethernet-switching>
Jun 17 10:43:36 [48789] Outgoing:                             <port-mode>access</port-mode>
Jun 17 10:43:36 [48789] Outgoing:                         </ethernet-switching>
Jun 17 10:43:36 [48789] Outgoing:                     </family>
Jun 17 10:43:36 [48789] Outgoing:                 </unit>
Jun 17 10:43:36 [48789] Outgoing:             </interface>
Jun 17 10:43:36 [48789] Outgoing:         </interfaces>
Jun 17 10:43:36 [48789] Outgoing:     </groups>
Jun 17 10:43:36 [48789] Outgoing:     <groups>
Jun 17 10:43:36 [48789] Outgoing:         <name>trunk</name>
Jun 17 10:43:36 [48789] Outgoing:         <interfaces>
Jun 17 10:43:36 [48789] Outgoing:             <interface>
Jun 17 10:43:36 [48789] Outgoing:                 <name>&lt;ge-*&gt;</name>
Jun 17 10:43:36 [48789] Outgoing:                 <mtu>4484</mtu>
Jun 17 10:43:36 [48789] Outgoing:                 <unit>
Jun 17 10:43:36 [48789] Outgoing:                     <name>0</name>
Jun 17 10:43:36 [48789] Outgoing:                     <family>
Jun 17 10:43:36 [48789] Outgoing:                         <ethernet-switching>
Jun 17 10:43:36 [48789] Outgoing:                             <port-mode>trunk</port-mode>
Jun 17 10:43:36 [48789] Outgoing:                             <vlan>
Jun 17 10:43:36 [48789] Outgoing:                                 <members>all</members>
Jun 17 10:43:36 [48789] Outgoing:                             </vlan>
Jun 17 10:43:36 [48789] Outgoing:                         </ethernet-switching>
Jun 17 10:43:36 [48789] Outgoing:                     </family>
Jun 17 10:43:36 [48789] Outgoing:                 </unit>
Jun 17 10:43:36 [48789] Outgoing:             </interface>
Jun 17 10:43:36 [48789] Outgoing:             <interface>
Jun 17 10:43:36 [48789] Outgoing:                 <name>&lt;xe-*&gt;</name>
Jun 17 10:43:36 [48789] Outgoing:                 <mtu>4484</mtu>
Jun 17 10:43:36 [48789] Outgoing:                 <unit>
Jun 17 10:43:36 [48789] Outgoing:                     <name>0</name>
Jun 17 10:43:36 [48789] Outgoing:                     <family>
Jun 17 10:43:36 [48789] Outgoing:                         <ethernet-switching>
Jun 17 10:43:36 [48789] Outgoing:                             <port-mode>trunk</port-mode>
Jun 17 10:43:36 [48789] Outgoing:                             <vlan>
Jun 17 10:43:36 [48789] Outgoing:                                 <members>all</members>
Jun 17 10:43:36 [48789] Outgoing:                             </vlan>
Jun 17 10:43:36 [48789] Outgoing:                         </ethernet-switching>
Jun 17 10:43:36 [48789] Outgoing:                     </family>
Jun 17 10:43:36 [48789] Outgoing:                 </unit>
Jun 17 10:43:36 [48789] Outgoing:             </interface>
Jun 17 10:43:36 [48789] Outgoing:         </interfaces>
Jun 17 10:43:36 [48789] Outgoing:     </groups>
Jun 17 10:43:36 [48789] Outgoing:     <system>
Jun 17 10:43:36 [48789] Outgoing:         <host-name>ex4200-13</host-name>
Jun 17 10:43:36 [48789] Outgoing:         <domain-name>poc-nl.jnpr.net</domain-name>
Jun 17 10:43:36 [48789] Outgoing:         <time-zone>Europe/Amsterdam</time-zone>
Jun 17 10:43:36 [48789] Outgoing:         <authentication-order>radius</authentication-order>
Jun 17 10:43:36 [48789] Outgoing:         <authentication-order>password</authentication-order>
Jun 17 10:43:36 [48789] Outgoing:         <root-authentication>
Jun 17 10:43:36 [48789] Outgoing:             <encrypted-password>$1$/NHg28eO$pqaVlLlPQ2thlQQ0ZB.Vx/</encrypted-password>
Jun 17 10:43:36 [48789] Outgoing:         </root-authentication>
Jun 17 10:43:36 [48789] Outgoing:         <name-server>
Jun 17 10:43:36 [48789] Outgoing:             <name>172.30.179.2</name>
Jun 17 10:43:36 [48789] Outgoing:         </name-server>
Jun 17 10:43:36 [48789] Outgoing:         <name-server>
Jun 17 10:43:36 [48789] Outgoing:             <name>172.30.179.3</name>
Jun 17 10:43:36 [48789] Outgoing:         </name-server>
Jun 17 10:43:36 [48789] Outgoing:         <radius-server>
Jun 17 10:43:36 [48789] Outgoing:             <name>172.30.176.9</name>
Jun 17 10:43:36 [48789] Outgoing:             <secret>$9$DMHPTz36CtOqmBEclLXik.mfT6/t1Eyn/</secret>
Jun 17 10:43:36 [48789] Outgoing:             <retry>3</retry>
Jun 17 10:43:36 [48789] Outgoing:         </radius-server>
Jun 17 10:43:36 [48789] Outgoing:         <radius-server>
Jun 17 10:43:36 [48789] Outgoing:             <name>172.30.176.4</name>
Jun 17 10:43:36 [48789] Outgoing:             <secret>$9$CgY9p1EcylvWx0B7VwgUDtuOBIEleWNVYre</secret>
Jun 17 10:43:36 [48789] Outgoing:             <retry>3</retry>
Jun 17 10:43:36 [48789] Outgoing:         </radius-server>
Jun 17 10:43:36 [48789] Outgoing:         <login>
Jun 17 10:43:36 [48789] Outgoing:             <user>
Jun 17 10:43:36 [48789] Outgoing:                 <name>pytraining-13</name>
Jun 17 10:43:36 [48789] Outgoing:                 <uid>2001</uid>
Jun 17 10:43:36 [48789] Outgoing:                 <class>super-user</class>
Jun 17 10:43:36 [48789] Outgoing:                 <authentication>
Jun 17 10:43:36 [48789] Outgoing:                     <encrypted-password>$1$uH0eoaXS$tTd6k7k.AVkEDhdJ8V75F.</encrypted-password>
Jun 17 10:43:36 [48789] Outgoing:                 </authentication>
Jun 17 10:43:36 [48789] Outgoing:             </user>
Jun 17 10:43:36 [48789] Outgoing:             <user>
Jun 17 10:43:36 [48789] Outgoing:                 <name>remote</name>
Jun 17 10:43:36 [48789] Outgoing:                 <uid>2000</uid>
Jun 17 10:43:36 [48789] Outgoing:                 <class>super-user</class>
Jun 17 10:43:36 [48789] Outgoing:             </user>
Jun 17 10:43:36 [48789] Outgoing:         </login>
Jun 17 10:43:36 [48789] Outgoing:         <services>
Jun 17 10:43:36 [48789] Outgoing:             <ftp>
Jun 17 10:43:36 [48789] Outgoing:             </ftp>
Jun 17 10:43:36 [48789] Outgoing:             <ssh>
Jun 17 10:43:36 [48789] Outgoing:                 <client-alive-interval>120</client-alive-interval>
Jun 17 10:43:36 [48789] Outgoing:             </ssh>
Jun 17 10:43:36 [48789] Outgoing:             <telnet>
Jun 17 10:43:36 [48789] Outgoing:             </telnet>
Jun 17 10:43:36 [48789] Outgoing:             <xnm-clear-text>
Jun 17 10:43:36 [48789] Outgoing:             </xnm-clear-text>
Jun 17 10:43:36 [48789] Outgoing:             <netconf>
Jun 17 10:43:36 [48789] Outgoing:                 <ssh>
Jun 17 10:43:36 [48789] Outgoing:                 </ssh>
Jun 17 10:43:36 [48789] Outgoing:                 <traceoptions>
Jun 17 10:43:36 [48789] Outgoing:                     <file>
Jun 17 10:43:36 [48789] Outgoing:                         <filename>netconf-ops.log</filename>
Jun 17 10:43:36 [48789] Outgoing:                         <size>3m</size>
Jun 17 10:43:36 [48789] Outgoing:                         <files>20</files>
Jun 17 10:43:36 [48789] Outgoing:                         <world-readable/>
Jun 17 10:43:36 [48789] Outgoing:                     </file>
Jun 17 10:43:36 [48789] Outgoing:                     <flag>
Jun 17 10:43:36 [48789] Outgoing:                         <name>all</name>
Jun 17 10:43:36 [48789] Outgoing:                     </flag>
Jun 17 10:43:36 [48789] Outgoing:                 </traceoptions>
Jun 17 10:43:36 [48789] Outgoing:             </netconf>
Jun 17 10:43:36 [48789] Outgoing:             <web-management>
Jun 17 10:43:36 [48789] Outgoing:                 <http>
Jun 17 10:43:36 [48789] Outgoing:                 </http>
Jun 17 10:43:36 [48789] Outgoing:             </web-management>
Jun 17 10:43:36 [48789] Outgoing:         </services>
Jun 17 10:43:36 [48789] Outgoing:         <syslog>
Jun 17 10:43:36 [48789] Outgoing:             <user>
Jun 17 10:43:36 [48789] Outgoing:                 <name>*</name>
Jun 17 10:43:36 [48789] Outgoing:                 <contents>
Jun 17 10:43:36 [48789] Outgoing:                     <name>any</name>
Jun 17 10:43:36 [48789] Outgoing:                     <emergency/>
Jun 17 10:43:36 [48789] Outgoing:                 </contents>
Jun 17 10:43:36 [48789] Outgoing:             </user>
Jun 17 10:43:36 [48789] Outgoing:             <host>
Jun 17 10:43:36 [48789] Outgoing:                 <name>172.30.189.13</name>
Jun 17 10:43:36 [48789] Outgoing:                 <contents>
Jun 17 10:43:36 [48789] Outgoing:                     <name>any</name>
Jun 17 10:43:36 [48789] Outgoing:                     <notice/>
Jun 17 10:43:36 [48789] Outgoing:                 </contents>
Jun 17 10:43:36 [48789] Outgoing:                 <contents>
Jun 17 10:43:36 [48789] Outgoing:                     <name>authorization</name>
Jun 17 10:43:36 [48789] Outgoing:                     <info/>
Jun 17 10:43:36 [48789] Outgoing:                 </contents>
Jun 17 10:43:36 [48789] Outgoing:                 <contents>
Jun 17 10:43:36 [48789] Outgoing:                     <name>interactive-commands</name>
Jun 17 10:43:36 [48789] Outgoing:                     <info/>
Jun 17 10:43:36 [48789] Outgoing:                 </contents>
Jun 17 10:43:36 [48789] Outgoing:             </host>
Jun 17 10:43:36 [48789] Outgoing:             <host>
Jun 17 10:43:36 [48789] Outgoing:                 <name>172.30.189.14</name>
Jun 17 10:43:36 [48789] Outgoing:                 <contents>
Jun 17 10:43:36 [48789] Outgoing:                     <name>any</name>
Jun 17 10:43:36 [48789] Outgoing:                     <notice/>
Jun 17 10:43:36 [48789] Outgoing:                 </contents>
Jun 17 10:43:36 [48789] Outgoing:                 <contents>
Jun 17 10:43:36 [48789] Outgoing:                     <name>authorization</name>
Jun 17 10:43:36 [48789] Outgoing:                     <info/>
Jun 17 10:43:36 [48789] Outgoing:                 </contents>
Jun 17 10:43:36 [48789] Outgoing:                 <contents>
Jun 17 10:43:36 [48789] Outgoing:                     <name>interactive-commands</name>
Jun 17 10:43:36 [48789] Outgoing:                     <info/>
Jun 17 10:43:36 [48789] Outgoing:                 </contents>
Jun 17 10:43:36 [48789] Outgoing:             </host>
Jun 17 10:43:36 [48789] Outgoing:             <file>
Jun 17 10:43:36 [48789] Outgoing:                 <name>messages</name>
Jun 17 10:43:36 [48789] Outgoing:                 <contents>
Jun 17 10:43:36 [48789] Outgoing:                     <name>any</name>
Jun 17 10:43:36 [48789] Outgoing:                     <notice/>
Jun 17 10:43:36 [48789] Outgoing:                 </contents>
Jun 17 10:43:36 [48789] Outgoing:                 <contents>
Jun 17 10:43:36 [48789] Outgoing:                     <name>authorization</name>
Jun 17 10:43:36 [48789] Outgoing:                     <info/>
Jun 17 10:43:36 [48789] Outgoing:                 </contents>
Jun 17 10:43:36 [48789] Outgoing:             </file>
Jun 17 10:43:36 [48789] Outgoing:         </syslog>
Jun 17 10:43:36 [48789] Outgoing:         <compress-configuration-files/>
Jun 17 10:43:36 [48789] Outgoing:         <commit>
Jun 17 10:43:36 [48789] Outgoing:             <synchronize/>
Jun 17 10:43:36 [48789] Outgoing:         </commit>
Jun 17 10:43:36 [48789] Outgoing:         <ntp>
Jun 17 10:43:36 [48789] Outgoing:             <boot-server>172.30.179.3</boot-server>
Jun 17 10:43:36 [48789] Outgoing:             <server>
Jun 17 10:43:36 [48789] Outgoing:                 <name>172.30.179.3</name>
Jun 17 10:43:36 [48789] Outgoing:             </server>
Jun 17 10:43:36 [48789] Outgoing:             <server>
Jun 17 10:43:36 [48789] Outgoing:                 <name>172.30.179.2</name>
Jun 17 10:43:36 [48789] Outgoing:             </server>
Jun 17 10:43:36 [48789] Outgoing:         </ntp>
Jun 17 10:43:36 [48789] Outgoing:     </system>
Jun 17 10:43:36 [48789] Outgoing:     <interfaces>
Jun 17 10:43:36 [48789] Outgoing:         <interface>
Jun 17 10:43:36 [48789] Outgoing:             <name>ge-0/0/0</name>
Jun 17 10:43:36 [48789] Outgoing:             <unit>
Jun 17 10:43:36 [48789] Outgoing:                 <name>0</name>
Jun 17 10:43:36 [48789] Outgoing:                 <family>
Jun 17 10:43:36 [48789] Outgoing:                     <inet>
Jun 17 10:43:36 [48789] Outgoing:                         <address>
Jun 17 10:43:36 [48789] Outgoing:                             <name>10.0.0.2/24</name>
Jun 17 10:43:36 [48789] Outgoing:                         </address>
Jun 17 10:43:36 [48789] Outgoing:                     </inet>
Jun 17 10:43:36 [48789] Outgoing:                 </family>
Jun 17 10:43:36 [48789] Outgoing:             </unit>
Jun 17 10:43:36 [48789] Outgoing:         </interface>
Jun 17 10:43:36 [48789] Outgoing:         <interface>
Jun 17 10:43:36 [48789] Outgoing:             <name>lo0</name>
Jun 17 10:43:36 [48789] Outgoing:             <unit>
Jun 17 10:43:36 [48789] Outgoing:                 <name>0</name>
Jun 17 10:43:36 [48789] Outgoing:                 <family>
Jun 17 10:43:36 [48789] Outgoing:                     <inet>
Jun 17 10:43:36 [48789] Outgoing:                         <address>
Jun 17 10:43:36 [48789] Outgoing:                             <name>192.179.0.113/32</name>
Jun 17 10:43:36 [48789] Outgoing:                             <preferred/>
Jun 17 10:43:36 [48789] Outgoing:                         </address>
Jun 17 10:43:36 [48789] Outgoing:                         <address>
Jun 17 10:43:36 [48789] Outgoing:                             <name>127.0.0.1/32</name>
Jun 17 10:43:36 [48789] Outgoing:                         </address>
Jun 17 10:43:36 [48789] Outgoing:                     </inet>
Jun 17 10:43:36 [48789] Outgoing:                     <iso>
Jun 17 10:43:36 [48789] Outgoing:                         <address>
Jun 17 10:43:36 [48789] Outgoing:                             <name>49.0179.0000.0000.0113.00</name>
Jun 17 10:43:36 [48789] Outgoing:                         </address>
Jun 17 10:43:36 [48789] Outgoing:                     </iso>
Jun 17 10:43:36 [48789] Outgoing:                 </family>
Jun 17 10:43:36 [48789] Outgoing:             </unit>
Jun 17 10:43:36 [48789] Outgoing:         </interface>
Jun 17 10:43:36 [48789] Outgoing:         <interface>
Jun 17 10:43:36 [48789] Outgoing:             <name>me0</name>
Jun 17 10:43:36 [48789] Outgoing:             <unit>
Jun 17 10:43:36 [48789] Outgoing:                 <name>0</name>
Jun 17 10:43:36 [48789] Outgoing:                 <family>
Jun 17 10:43:36 [48789] Outgoing:                     <inet>
Jun 17 10:43:36 [48789] Outgoing:                         <address>
Jun 17 10:43:36 [48789] Outgoing:                             <name>172.30.179.113/24</name>
Jun 17 10:43:36 [48789] Outgoing:                         </address>
Jun 17 10:43:36 [48789] Outgoing:                     </inet>
Jun 17 10:43:36 [48789] Outgoing:                 </family>
Jun 17 10:43:36 [48789] Outgoing:             </unit>
Jun 17 10:43:36 [48789] Outgoing:         </interface>
Jun 17 10:43:36 [48789] Outgoing:     </interfaces>
Jun 17 10:43:36 [48789] Outgoing:     <snmp>
Jun 17 10:43:36 [48789] Outgoing:         <location>AMS, EPOC 3.18</location>
Jun 17 10:43:36 [48789] Outgoing:         <contact>emea-poc@juniper.net</contact>
Jun 17 10:43:36 [48789] Outgoing:         <community>
Jun 17 10:43:36 [48789] Outgoing:             <name>public</name>
Jun 17 10:43:36 [48789] Outgoing:             <authorization>read-only</authorization>
Jun 17 10:43:36 [48789] Outgoing:             <clients>
Jun 17 10:43:36 [48789] Outgoing:                 <name>172.30.0.0/16</name>
Jun 17 10:43:36 [48789] Outgoing:             </clients>
Jun 17 10:43:36 [48789] Outgoing:             <clients>
Jun 17 10:43:36 [48789] Outgoing:                 <name>0.0.0.0/0</name>
Jun 17 10:43:36 [48789] Outgoing:                 <restrict/>
Jun 17 10:43:36 [48789] Outgoing:             </clients>
Jun 17 10:43:36 [48789] Outgoing:         </community>
Jun 17 10:43:36 [48789] Outgoing:         <community>
Jun 17 10:43:36 [48789] Outgoing:             <name>private</name>
Jun 17 10:43:36 [48789] Outgoing:             <authorization>read-write</authorization>
Jun 17 10:43:36 [48789] Outgoing:             <clients>
Jun 17 10:43:36 [48789] Outgoing:                 <name>172.30.0.0/16</name>
Jun 17 10:43:36 [48789] Outgoing:             </clients>
Jun 17 10:43:36 [48789] Outgoing:             <clients>
Jun 17 10:43:36 [48789] Outgoing:                 <name>0.0.0.0/0</name>
Jun 17 10:43:36 [48789] Outgoing:                 <restrict/>
Jun 17 10:43:36 [48789] Outgoing:             </clients>
Jun 17 10:43:36 [48789] Outgoing:         </community>
Jun 17 10:43:36 [48789] Outgoing:         <trap-options>
Jun 17 10:43:36 [48789] Outgoing:             <source-address>
Jun 17 10:43:36 [48789] Outgoing:                 <address>172.30.179.113</address>
Jun 17 10:43:36 [48789] Outgoing:             </source-address>
Jun 17 10:43:36 [48789] Outgoing:         </trap-options>
Jun 17 10:43:36 [48789] Outgoing:     </snmp>
Jun 17 10:43:36 [48789] Outgoing:     <routing-options>
Jun 17 10:43:36 [48789] Outgoing:         <static>
Jun 17 10:43:36 [48789] Outgoing:             <route>
Jun 17 10:43:36 [48789] Outgoing:                 <name>0.0.0.0/0</name>
Jun 17 10:43:36 [48789] Outgoing:                 <next-hop>172.30.179.1</next-hop>
Jun 17 10:43:36 [48789] Outgoing:                 <no-readvertise/>
Jun 17 10:43:36 [48789] Outgoing:             </route>
Jun 17 10:43:36 [48789] Outgoing:         </static>
Jun 17 10:43:36 [48789] Outgoing:         <router-id>192.179.0.113</router-id>
Jun 17 10:43:36 [48789] Outgoing:         <autonomous-system>
Jun 17 10:43:36 [48789] Outgoing:             <as-number>100</as-number>
Jun 17 10:43:36 [48789] Outgoing:         </autonomous-system>
Jun 17 10:43:36 [48789] Outgoing:     </routing-options>
Jun 17 10:43:36 [48789] Outgoing:     <vlans>
Jun 17 10:43:36 [48789] Outgoing:         <vlan>
Jun 17 10:43:36 [48789] Outgoing:             <name>test1</name>
Jun 17 10:43:36 [48789] Outgoing:             <vlan-id>1111</vlan-id>
Jun 17 10:43:36 [48789] Outgoing:         </vlan>
Jun 17 10:43:36 [48789] Outgoing:         <vlan>
Jun 17 10:43:36 [48789] Outgoing:             <name>test2</name>
Jun 17 10:43:36 [48789] Outgoing:             <vlan-id>1112</vlan-id>
Jun 17 10:43:36 [48789] Outgoing:         </vlan>
Jun 17 10:43:36 [48789] Outgoing:         <vlan>
Jun 17 10:43:36 [48789] Outgoing:             <name>test3</name>
Jun 17 10:43:36 [48789] Outgoing:             <vlan-id>1113</vlan-id>
Jun 17 10:43:36 [48789] Outgoing:         </vlan>
Jun 17 10:43:36 [48789] Outgoing:     </vlans>
Jun 17 10:43:36 [48789] Outgoing: </configuration>
Jun 17 10:43:36 [48789] Outgoing: </rpc-reply>
Jun 17 10:43:36 [48789] Outgoing: ]]>]]>
Jun 17 10:43:36 [48789] 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:94c9e182-3467-11e6-bdb3-000c29432de4"><lock-configuration/></nc:rpc>]]>]]>
Jun 17 10:43:36 [48789] Outgoing: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/14.1X53/junos" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:94c9e182-3467-11e6-bdb3-000c29432de4">
Jun 17 10:43:36 [48789] Outgoing: </rpc-reply>
Jun 17 10:43:36 [48789] Outgoing: ]]>]]>
Jun 17 10:43:36 [48789] 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:94dc9a8e-3467-11e6-bdb3-000c29432de4"><load-configuration action="set" format="text"><configuration-set>set system host-name newname</configuration-set></load-configuration></nc:rpc>]]>]]>
Jun 17 10:43:36 [48789] Outgoing: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/14.1X53/junos" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:94dc9a8e-3467-11e6-bdb3-000c29432de4">
Jun 17 10:43:36 [48789] Outgoing: <load-configuration-results>
Jun 17 10:43:36 [48789] Outgoing: <ok/>
Jun 17 10:43:36 [48789] Outgoing: </load-configuration-results>
Jun 17 10:43:36 [48789] Outgoing: </rpc-reply>
Jun 17 10:43:36 [48789] Outgoing: ]]>]]>
Jun 17 10:43:37 [48789] 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:94f6f528-3467-11e6-bdb3-000c29432de4"><get-configuration compare="rollback" rollback="0" format="text"/></nc:rpc>]]>]]>
Jun 17 10:43:37 [48789] Outgoing: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/14.1X53/junos" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:94f6f528-3467-11e6-bdb3-000c29432de4">
Jun 17 10:43:37 [48789] Outgoing: <configuration-information>
Jun 17 10:43:37 [48789] Outgoing: <configuration-output>
Jun 17 10:43:37 [48789] Outgoing: [edit system]
Jun 17 10:43:37 [48789] Outgoing: -  host-name ex4200-13;
Jun 17 10:43:37 [48789] Outgoing: +  host-name newname;
Jun 17 10:43:37 [48789] Outgoing: </configuration-output>
Jun 17 10:43:37 [48789] Outgoing: </configuration-information>
Jun 17 10:43:37 [48789] Outgoing: </rpc-reply>
Jun 17 10:43:37 [48789] Outgoing: ]]>]]>
Jun 17 10:43:37 [48789] 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:9565a07c-3467-11e6-bdb3-000c29432de4"><commit-configuration><check/></commit-configuration></nc:rpc>]]>]]>
Jun 17 10:43:37 [48789] Outgoing: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/14.1X53/junos" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9565a07c-3467-11e6-bdb3-000c29432de4">
Jun 17 10:43:37 [48789] Outgoing: <commit-results>
Jun 17 10:43:39 [48789] Outgoing: <routing-engine junos:style="normal">
Jun 17 10:43:39 [48789] Outgoing: <name>fpc0</name>
Jun 17 10:43:39 [48789] Outgoing: <commit-check-success/>
Jun 17 10:43:39 [48789] Outgoing: </routing-engine>
Jun 17 10:43:39 [48789] Outgoing: </commit-results>
Jun 17 10:43:39 [48789] Outgoing: <ok/>
Jun 17 10:43:39 [48789] Outgoing: </rpc-reply>
Jun 17 10:43:39 [48789] Outgoing: ]]>]]>
Jun 17 10:43:39 [48789] 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:96662b2c-3467-11e6-bdb3-000c29432de4"><commit-configuration><confirm-timeout>1</confirm-timeout><confirmed/><log>update config</log></commit-configuration></nc:rpc>]]>]]>
Jun 17 10:43:39 [48789] Outgoing: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/14.1X53/junos" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:96662b2c-3467-11e6-bdb3-000c29432de4">
Jun 17 10:43:39 [48789] Outgoing: <commit-results>
Jun 17 10:43:41 [48789] Outgoing: <routing-engine junos:style="normal">
Jun 17 10:43:41 [48789] Outgoing: <name>fpc0</name>
Jun 17 10:43:41 [48789] Outgoing: <commit-check-success/>
Jun 17 10:43:44 [48789] Outgoing: <commit-success/>
Jun 17 10:43:44 [48789] Outgoing: </routing-engine>
Jun 17 10:43:44 [48789] Outgoing: </commit-results>
Jun 17 10:43:44 [48789] Outgoing: <ok/>
Jun 17 10:43:44 [48789] Outgoing: </rpc-reply>
Jun 17 10:43:44 [48789] Outgoing: ]]>]]>
Jun 17 10:43:44 [48789] 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:99986dc8-3467-11e6-bdb3-000c29432de4"><unlock-configuration/></nc:rpc>]]>]]>
Jun 17 10:43:44 [48789] Outgoing: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/14.1X53/junos" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:99986dc8-3467-11e6-bdb3-000c29432de4">
Jun 17 10:43:44 [48789] Outgoing: </rpc-reply>
Jun 17 10:43:46 [48789] Outgoing: ]]>]]>
Jun 17 10:43:46 [48789] Outgoing: <!-- session end at 2016-06-17 10:43:46 CEST -->
stianvi commented 8 years ago

Fixed in #4008

ansibot commented 8 years ago

@privateip, ping. This issue is still waiting on your response. click here for bot help

agaffney commented 8 years ago

Even with the fix in 2.1.1, this doesn't seem to be working for me. I'm trying to use delete system ntp to clear out all NTP info before setting the correct server, but the diff only shows it adding the new server.

Edit: my problem may be unrelated. It looks like lxml is screwing up somehow and returning an empty string when ele.text is used in the get_config() function in module_utils/junos.py

Edit2: it's not lxml screwing up. JunOS is sending XML format when format='set' is specified for the get_configuration RPC call :(

Edit3: created https://github.com/ansible/ansible/issues/17111 for the issue I discovered

ansibot commented 8 years ago

@privateip, @gundalow, ping. This issue is still waiting on your response. click here for bot help

gundalow commented 8 years ago

We believe this is fixed, though we need to test to confirm

ansibot commented 8 years ago

@privateip, @gundalow, ping. This issue is still waiting on your response. click here for bot help

ansibot commented 8 years ago

@privateip, @gundalow, ping. This issue is still waiting on your response. click here for bot help

ansibot commented 8 years ago

@privateip, @gundalow, ping. This issue is still waiting on your response. click here for bot help

ansibot commented 8 years ago

@privateip, @gundalow, ping. This issue is still waiting on your response. click here for bot help

ansibot commented 8 years ago

@privateip, @gundalow, @qalthos, ping. This issue is still waiting on your response. click here for bot help

ansibot commented 7 years ago

This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible

Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.

ansibot commented 7 years ago

This issue was migrated to https://github.com/ansible/ansible/issues/29775