Skip to content

Commit

Permalink
Change the boot disk to be first in boot order for ubuntu 23.04 deskt…
Browse files Browse the repository at this point in the history
…op after deploy_vm (#473)

Signed-off-by: ZouYuhua <[email protected]>
  • Loading branch information
ZouYuhua authored Jun 15, 2023
1 parent 7a9ee60 commit 5ad2fb3
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions linux/deploy_vm/deploy_vm_from_iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,22 @@

# Remove serial port
- include_tasks: ../utils/shutdown.yml

- name: "Change CD/DVD to client device and set disk as first boot device for Ubuntu"
block:
- name: "Change VM's CD/DVD Drive 1 to client device"
include_tasks: ../../common/vm_configure_cdrom.yml
vars:
cdrom_state: present
cdrom_type: client
cdrom_controller_num: "{{ vm_cdroms[0].controller_number | int }}"
cdrom_unit_num: "{{ vm_cdroms[0].unit_number | int }}"

# Disconnect OS image from Ubuntu Linux VM and change to client device
- name: "Change VM's CD/DVD Drive 1 to client device"
include_tasks: ../../common/vm_configure_cdrom.yml
vars:
cdrom_state: present
cdrom_type: client
cdrom_controller_num: "{{ vm_cdroms[0].controller_number | int }}"
cdrom_unit_num: "{{ vm_cdroms[0].unit_number | int }}"
- name: "Change the boot disk to be first in boot order"
include_tasks: ../../common/vm_set_boot_options.yml
vars:
boot_order_list:
- disk
when: guest_os_ansible_distribution == "Ubuntu"

- name: "Download serial output file before removing serial port"
Expand Down

0 comments on commit 5ad2fb3

Please sign in to comment.