post

Update the firmware on Dell hosts using Ansible

Dell provides an https website with firmware updates. If your host can reach https://downloads.dell.com you can update Dell firmware using Ansible and the dellemc.openmanage module.

First install the dellemc.openmanage module:

ansible-galaxy collection install \
    --force-with-deps dellemc.openmanage

Then add the following playbook to your roles:

---
# ansible/roles/firmware_update/tasks/main.yml

- name: Update Dell firmware
  delegate_to: localhost
  become: False
  block:

  - name: Update firmware from downloads.dell.com
    dellemc.openmanage.idrac_firmware:
      share_name: "https://downloads.dell.com"
      idrac_ip: "{{ inventory_hostname }}.{{ subdomain }}"
      idrac_user: "{{ ilo_admin_user_name }}"
      idrac_password: "{{ ilo_admin_password }}"
      validate_certs: False
      reboot: True
      job_wait: True
      apply_update: True
    register: firmware

- name: Pause for 5 minutes before trying the next host
  ansible.builtin.pause:
    minutes: 5
  when: firmware.changed

This playbook will check to see if any firmware updates are available and if there are any it will immediately apply them, possibly rebooting the host.

You do not want to apply this to an entire cluster of hosts running some distributed application, such as Kubernetes or vSAN, because it could reboot all of the hosts at the same time, trashing your environment. To ensure that Ansible only updates one host at a time use the serial command in the playbook that calls this role:

# main.yml

- name: Update Dell firmware
  gather_facts: False
  hosts: firmware_update_hosts
  serial: 1
  roles:
    - firmware_update

Hope you find this useful.

Want to learn Ansible? Start on the Ansible Community Documentation page and just start automating your environment. Want to level-up your Ansible skills? I highly recommend the O’Reilly book Ansible: Up and Running.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.