
Change-Id: I2ed443bc4b74fa34b169f87f08b7f0a0b68144c0 Depends-On: https://review.opendev.org/760586
56 lines
1.6 KiB
YAML
56 lines
1.6 KiB
YAML
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
# implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
---
|
|
- name: "Create a temporary directory for mounting ESP"
|
|
tempfile:
|
|
state: directory
|
|
register: esp_temp_dir
|
|
|
|
- name: "Create an empty ESP image"
|
|
command: dd if=/dev/zero of={{ esp_image }} bs=4096 count=1024
|
|
|
|
- name: "Initialize ESP filesystem"
|
|
command: mkfs.fat -s 4 -r 512 -S 4096 {{ esp_image }}
|
|
|
|
- name: "Mount ESP filesystem"
|
|
command: mount {{ esp_image }} {{ esp_temp_dir.path }} # noqa 303
|
|
|
|
- block:
|
|
- name: "Create ESP boot directory"
|
|
file:
|
|
path: "{{ esp_temp_dir.path }}/EFI/BOOT"
|
|
state: directory
|
|
|
|
- name: "Copy the shim image to ESP"
|
|
copy:
|
|
src: "{{ shim_efi_binary }}"
|
|
remote_src: true
|
|
dest: "{{ esp_temp_dir.path }}/EFI/BOOT/BOOTX64.efi"
|
|
|
|
- name: "Copy the grub2 image to ESP"
|
|
copy:
|
|
src: "{{ grub_efi_binary }}"
|
|
remote_src: true
|
|
dest: "{{ esp_temp_dir.path }}/EFI/BOOT/GRUBX64.efi"
|
|
|
|
always:
|
|
- name: "Unmount ESP filesystem"
|
|
command: umount {{ esp_temp_dir.path }}
|
|
|
|
- name: "Ensure ESP image is readable"
|
|
file:
|
|
path: "{{ esp_image }}"
|
|
owner: ironic
|
|
group: ironic
|
|
mode: 0644
|