Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
upgrade_esxi_vib.yaml
---
- hosts: dunn-esxi:!*dc-esxihost-01*
vars:
#Set the source VIB file to copy, Source Location, and Destination Location
src_vib: NVIDIA-VMware-450.55-1OEM.670.0.0.8169922.x86_64.vib
src_location: ~/Downloads/NVIDIA-GRID-vSphere-6.7-450.55-450.51.05-451.48/
dest_location: /tmp/
tasks:
- name: Enter Maintenance Mode
register: status
vmware_maintenancemode:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
esxi_hostname: "{{ inventory_hostname }}"
vsan: ensureObjectAccessibility
evacuate: yes
validate_certs: no
timeout: 3600
state: present
delegate_to: localhost
- debug: var=status.msg
- name: Copy {{ src_vib }} to ESXI Host
copy:
src="{{ src_location }}{{ src_vib }}"
dest="{{ dest_location }}{{src_vib}}"
- name: Search for existing VIB installation
shell: esxcli software vib list | grep NVIDIA
register: vibs
changed_when: false
ignore_errors: yes
- debug: var=vibs.stdout
- name: Run a removal if VIB is already installed
shell: esxcli software vib remove -n NVIDIA-VMware_ESXi_6.7_Host_Driver
when: "'NVIDIA' in vibs.stdout"
- name: Install it
shell: esxcli software vib install -v /tmp/NVIDIA-VMware-450.55-1OEM.670.0.0.8169922.x86_64.vib
- name: Confirm VIB is installed
shell: esxcli software vib list | grep NVIDIA
register: vibs
changed_when: false
ignore_errors: yes
- debug: var=vibs.stdout
- name: Exit Maintenance Mode
vmware_maintenancemode:
register: mainteance
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
esxi_hostname: "{{ inventory_hostname }}"
vsan: ensureObjectAccessibility
evacuate: no
validate_certs: no
timeout: 3600
state: absent
delegate_to: localhost
- debug: var=mainteance.status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.