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

juniper_junos_software - install on other RE prevented by version check

Open pwlodawi opened this issue 4 years ago • 1 comments

Issue Type

  • Bug Report

juniper_junos_software

Summary

I'm trying to upgrade sw on dual RE box that doesn't use fxp0 interfaces for management. Because fxp0s are not used I connect to loopback interface i.e. always to master RE. To specify RE to install on I use re0 or re1 in kwargs.

Procedure is as follows (let's assume re0 is a master and both REs have version X installed):

  1. install version Y on re1 and reboot re1
  2. wait for re1 to reboot
  3. perform RE switch (got disconnected here, re1 becomes the master)
  4. reconnect (now connected to re1 which is master now)
  5. install version Y on re0. This install fails because of version check. Version check is performed on re1 which is already Y and doesn't check kwargs so it can't know that install should be on re0 which is still X

The workaround could be to make version check aware of kwargs e.g. software.py:652

for re in facts['junos_info']:                     
    if re in kwargs:                                                
        current_version = facts['junos_info'][re]['text']
        re_name = re                                                

The other option could be to to add a new option to install on re other than one connection is made to. It could be for instance other_re similar to all_re (of course all_re and other_re being mutually exclusive).

pwlodawi avatar Jan 30 '21 22:01 pwlodawi