ansible-junos-stdlib icon indicating copy to clipboard operation
ansible-junos-stdlib copied to clipboard

juniper_junos_software: update fails in virtual chassis with 4 members

Open niklash-dev opened this issue 6 years ago • 0 comments

Issue Type

  • Bug Report

Module Name

juniper_junos_software

ansible 2.4.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Apr 11 2018, 07:36:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]

OS / Environment

Ansible server: CentOS Junos: 15.1X53-D59.3 Device: EX2300-48

Summary

The update process fails after updating the master in an virtual chassi with 4 members, when member 0 is not the master. It works fine when you force member 0 to be the master first.

Steps to reproduce

  1. Set up a virtual chassi with 4 memebers
  2. Make member 1,2 or 3 master. Not member 0.
  3. Update the switch using Ansible
- name: Perform a Junos OS software upgrade
  hosts: juniper
  roles:
    - Juniper.junos
  connection: local
  gather_facts: no

  vars:
    wait_time: 3000
    local_dir: /var/testing/software
    OS_version: 15.1X53-D59.3
    OS_package: junos-arm-32-15.1X53-D59.3.tgz
    log_dir: /var/testing/playbooks/log

  tasks:
    - name: Perform update
      juniper_junos_software:
        local_package: "{{ local_dir }}/{{ OS_package }}"
        reboot: false
        logfile: "{{ log_dir }}/ansible.log"

Expected results

A normal update with no reboot and that the "show version" command shows 4 pending installs.

Actual results

The ansible playbooks fails. The "show version" command shows only a few pending installs. It shows pending installs for every member with a higher member id then the master and for the master.

2018-09-12 10:36:57,793 - ncclient.operations.rpc - DEBUG - Delivering to <ncclient.operations.session.CloseSession object at 0x7f7644e8c450>
2018-09-12 10:36:57,793 - ncclient.transport.ssh - DEBUG - Trying another round of parsing since there is still data
2018-09-12 10:36:57,793 - ncclient.transport.ssh - DEBUG - parsing netconf v1.0
2018-09-12 10:36:57,793 - ncclient.transport.ssh - DEBUG - Selecting netconf:base:1.0 for encoding
2018-09-12 10:36:57,794 - ncclient.transport.ssh - DEBUG - parsing netconf v1.0
2018-09-12 10:36:57,799 - ncclient.transport.ssh - DEBUG - [chan netconf-subsystem-0] EOF received (netconf-subsystem-0)
2018-09-12 10:36:57,800 - ncclient.transport.ssh - DEBUG - Broke out of main loop, error=SessionCloseError('Unexpected session close\nIN_BUFFER: `\n<!-- session end at 2018-08-12 10:33:10 CEST -->\n`',)
2018-09-12 10:36:57,800 - ncclient.transport.session - DEBUG - dispatching error to <jnpr.junos.device.DeviceSessionListener object at 0x7f7644eb5990>
2018-09-12 10:36:57,800 - ncclient.transport.session - DEBUG - dispatching error to <ncclient.transport.session.NotificationHandler object at 0x7f7644eb5550>
2018-09-12 10:36:57,800 - ncclient.transport.session - DEBUG - dispatching error to <ncclient.operations.rpc.RPCReplyListener object at 0x7f7644eb5e10>
2018-09-12 10:36:57,804 - ncclient.transport.ssh - DEBUG - EOF in transport thread
2018-09-12 10:36:57,829 - jnpr.ansible_module.juniper_junos_software - DEBUG - [10.XX.XX.XX] Device closed.
2018-09-12 10:36:57,830 - jnpr.ansible_module.juniper_junos_software - DEBUG - [10.XX.XX.XX] Fail JSON: {'msg': "Installation failed. Error: RpcError(severity: error, bad_element: None, message: error: File does not exist: /var/tmp/junos-arm-32-15.1X53-D57.3.tgz\nerror: Couldn't retrieve package /var/tmp/junos-arm-32-15.1X53-D57.3.tgz)", 'failed': True, 'changed': True, 'check_mode': False}

niklash-dev avatar Sep 12 '18 13:09 niklash-dev