ansible-junos-stdlib
ansible-junos-stdlib copied to clipboard
juniper_junos_software - install on other RE prevented by version check
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):
- install version Y on re1 and reboot re1
- wait for re1 to reboot
- perform RE switch (got disconnected here, re1 becomes the master)
- reconnect (now connected to re1 which is master now)
- 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).
Hi @pwlodawi Above operations are similar ISSU upgrade, could you please refer the following playbook for ISSU upgrade of the device and let us know the results.
---
- name: Test juniper.device.software module
hosts: all
collections:
- juniper.device
gather_facts: no
vars:
wait_time: 3600
pkg_dir: /var/tmp/
OS_version: 24.3
OS_package: junos-x86-64-24.3.tgz
log_dir: /var/log/
tasks:
- name: Checking NETCONF connectivity
wait_for: host={{ ansible_ssh_host }} port=830 timeout=5
- name: Install Junos OS package
software:
reboot: False
issu: True
no_copy: True
all_re: True
version: "{{ OS_version }}"
package: "{{ pkg_dir }}/{{ OS_package }}"
logfile: "{{ log_dir }}/software.log"
register: test1
notify:
- wait_reboot
- name: Print response
debug:
var: test1
- name: Check TEST - 1
assert:
that:
- test1.failed == false
handlers:
- name: wait_reboot
wait_for: host={{ ansible_ssh_host }} port=830 timeout={{ wait_time }}
when: not test1.check_mode
Thanks Chidanand