-
Couldn't load subscription status.
- Fork 167
Description
Issue Type
- Feature Idea
Module Name
juniper.device.software
-->
OS / Environment
VMHOST
Summary
During software upgrade on VMHOST devices, current_version = facts["version"] , version details are taken from facts "show version" output, this needs to be updated to get the version details from "show vmhost version" .
Steps to reproduce
install the image on VMHOST device.
- Install vmhost-x86_64-23.2R2-S1 image and reboot.
Version: set p
VMHost Version: 7.2682
VMHost Root: vmhost-x86_64-22.2R3-S3-20231220_2041_builder
VMHost Core: vmhost-core-x86-64-22.2R3-S3.18
kernel: 5.2.60-rt15-LTS19
Junos Disk: junos-install-mx-x86-64-22.2R3-S3.18
Version: set b
VMHost Version: 7.2745
VMHost Root: vmhost-x86_64-23.2R2-S1-20240412_1024_builder
VMHost Core: vmhost-core-x86-64-23.2R2-S1.3
kernel: 5.2.60-rt15-LTS19
Junos Disk: junos-install-mx-x86-64-23.2R2-S1.3
- Install vmhost-x86_64-23.2R2-S1 image again with version check True.
cat pb.juniper_junos_software.yml
---
- name: Test juniper.device.software module
hosts: all
gather_facts: false
vars:
wait_time: 3600
pkg_dir: /var/tmp/
os_version: 22.2R3
os_package: junos-vmhost-install-mx-x86-64-22.2R3-S3.18.tgz
log_dir: /var/log/
tasks:
- name: Checking NETCONF connectivity
ansible.builtin.wait_for:
host: "{{ ansible_ssh_host }}"
port: 830
timeout: 5
- name: Install Junos OS package
juniper.device.software:
vmhost: true
reboot: False
no_copy: true
all_re: false
version: false
validate: false
package: "{{ pkg_dir }}/{{ os_package }}"
logfile: "{{ log_dir }}/software.log"
register: test1
ignore_errors: true
#notify:
#- Wait_reboot
- name: Print response
ansible.builtin.debug:
var: test1
- name: Check TEST - 1
ansible.builtin.assert:
that:
- test1.failed == false
- name: Checking NETCONF connectivity
ansible.builtin.wait_for:
host: "{{ ansible_ssh_host }}"
port: 830
timeout: 600
delay: 15
- name: Reboot the device
juniper.device.system:
action: "reboot"
vmhost: true
all_re: false
register: test1
ignore_errors: true
tags: [test1]
- name: CHECK TEST 1
ansible.builtin.assert:
that:
- test1.reboot == true
tags: [test1]
- name: Checking NETCONF connectivity
ansible.builtin.wait_for:
host: "{{ ansible_ssh_host }}"
port: 830
timeout: 600
delay: 300
- name: Install Junos OS package
juniper.device.software:
vmhost: true
reboot: False
no_copy: true
all_re: false
version: false
validate: false
package: "{{ pkg_dir }}/{{ os_package }}"
logfile: "{{ log_dir }}/software.log"
register: test1
ignore_errors: true
#notify:
#- Wait_reboot
- name: Print response
ansible.builtin.debug:
var: test1
- name: Check TEST - 1
ansible.builtin.assert:
that:
- test1.failed == false
- name: Checking NETCONF connectivity
ansible.builtin.wait_for:
host: "{{ ansible_ssh_host }}"
port: 830
timeout: 600
delay: 15