---
- hosts: ome
  connection: local
  name: "OME - Update Firmware"
  gather_facts: False

  collections:
    - dellemc.openmanage

  tasks:
  - name: "Update firmware from a DUP file using a device ids."
    ome_firmware:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      device_id:
        - 11111
        - 22222
      dup_file: "/path/Chassis-System-Management_Firmware_6N9WN_WN64_1.00.01_A00.EXE"
    tags:
      - device-ids

  - name: "Update firmware from a DUP file using a device service tags."
    ome_firmware:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      device_service_tag:
        - KLBR111
        - KLBR222
      dup_file: "/path/Network_Firmware_NTRW0_WN64_14.07.07_A00-00_01.EXE"
    tags:
      - service-tags

  - name: "Update firmware from a DUP file using a device group names."
    ome_firmware:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      device_group_names:
        - servers
      dup_file: "/path/BIOS_87V69_WN64_2.4.7.EXE"
    tags:
      - group-name

  - name: "Update firmware using baseline name."
    ome_firmware:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      baseline_name: baseline_devices
    tags:
      - baseline-name

  - name: "Update firmware from a DUP file using a baseline names."
    ome_firmware:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      baseline_name: "baseline_devices, baseline_groups"
      dup_file: "/path/BIOS_87V69_WN64_2.4.7.EXE"
    tags:
      - baseline-name-dup