Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

juniper.device.sofware: MX vmhost device software upgrade with version check needs to be enhanced to support " show vmhost version" details #709

Open
chidanandpujar opened this issue Dec 20, 2024 · 0 comments

Comments

@chidanandpujar
Copy link
Collaborator

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.

  1. 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

  1. 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


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant