dell / dellemc-openmanage-ansible-modules

Dell OpenManage Ansible Modules
GNU General Public License v3.0
336 stars 163 forks source link

Feature request: Add HTTPs boot option to idrac_os_deployment #256

Closed liamwh closed 3 years ago

liamwh commented 3 years ago

Or alternatively equivalent to selecting this option in the iDRAC console:

image

anupamaloke commented 3 years ago

@liamwh, in order to boot from a virtual CD/DVD drive using an ISO file from a HTTP/S location, you can maybe use the virtual media. For e.g., following is the sample playbook:

 tasks:
  - name: Get virtual media info
    community.general.redfish_info:
      baseuri: "{{ inventory_hostname }}"
      username: "{{ idrac_user }}"
      password: "{{ idrac_password }}"
      category: "Manager"
      command: "GetVirtualMedia"
    delegate_to: localhost

  - name: Insert virtual media
    community.general.redfish_command:
      baseuri: "{{ inventory_hostname }}"
      username: "{{ idrac_user }}"
      password: "{{ idrac_password }}"
      category: "Manager"
      command: "VirtualMediaInsert"
      resource_id: "iDRAC.Embedded.1"
      virtual_media:
        image_url: "http://192.168.10.10/iso/test.iso"
        media_types:
          - CD
          - DVD
    delegate_to: localhost

  - name: Set one-time boot to CD
    community.general.idrac_redfish_config:
      baseuri: "{{ inventory_hostname }}"
      username: "{{ idrac_user }}"
      password: "{{ idrac_passwword }}"
      category: Manager
      command: SetManagerAttributes
      resource_id: iDRAC.Embedded.1
      manager_attributes:
        ServerBoot.1.FirstBootDevice: "VCD-DVD"
    delegate_to: localhost

  - name: Restart server
    dellemc.openmanage.redfish_powerstate:
      baseuri: "{{ inventory_hostname }}"
      username: "{{ idrac_user }}"
      password: "{{ idrac_password }}"
      resource_id: "System.Embedded.1"
      reset_type: "ForceRestart"

  - name: wait for 30 min for OS deployment to finish
    ansible.builtin.wait_for:
      timeout: 1800
    delegate_to: localhost

  - name: Eject virtual media
    community.general.redfish_command:
      baseuri: "{{ inventory_hostname }}"
      username: "{{ idrac_user }}"
      password: "{{ idrac_password }}"
      category: "Manager"
      command: "VirtualMediaEject"
      resource_id: "iDRAC.Embedded.1"
      virtual_media:
        image_url: "http://192.168.10.10/iso/test.iso"
    delegate_to: localhost
liamwh commented 3 years ago

Hi there,

Unfortunately this does not work as we require authentication to the https source. See below:

Code: image

Result: image

liamwh commented 3 years ago

Hi there, I have worked around this issue using an unauthenticated HTTPS server. Closing request.