---
- name: Dell OpenManage Ansible slot name configuration.
  hosts: ome
  gather_facts: false

  tasks:
    - name: Rename the slots in multiple chassis using slot number and chassis service tag.
      dellemc.openmanage.ome_chassis_slots:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        ca_path: "/path/to/ca_cert.pem"
        slot_options:
          - chassis_service_tag: ABC1234
            slots:
              - slot_number: 1
                slot_name: sled_name_1
              - slot_number: 2
                slot_name: sled_name_2
          - chassis_service_tag: ABC1235
            slots:
              - slot_number: 1
                slot_name: sled_name_1
              - slot_number: 2
                slot_name: sled_name_2
      delegate_to: localhost

    - name: Rename single slot name of the sled using sled ID
      dellemc.openmanage.ome_chassis_slots:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        ca_path: "/path/to/ca_cert.pem"
        device_options:
          - device_id: 10054
            slot_name: slot_device_name_1
      delegate_to: localhost

    - name: Rename single slot name of the sled using sled service tag
      dellemc.openmanage.ome_chassis_slots:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        ca_path: "/path/to/ca_cert.pem"
        device_options:
          - device_service_tag: ABC1234
            slot_name: service_tag_slot
      delegate_to: localhost

    - name: Rename multiple slot names of the devices
      dellemc.openmanage.ome_chassis_slots:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        ca_path: "/path/to/ca_cert.pem"
        device_options:
          - device_id: 10054
            slot_name: sled_name_1
          - device_service_tag: ABC1234
            slot_name: sled_name_2
          - device_id: 10055
            slot_name: sled_name_3
          - device_service_tag: PQR1234
            slot_name: sled_name_4
      delegate_to: localhost
