From d616abe80738c0de0c56924a5b5f26d19fc218be Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Sun, 13 Jun 2021 02:39:47 +0700 Subject: [PATCH] Replace kickstart files with ignition --- metal/roles/pxe-boot/defaults/main.yml | 1 + metal/roles/pxe-boot/templates/docker-compose.yml | 10 +++++++++- metal/roles/pxe-boot/templates/http/Dockerfile | 2 -- .../roles/pxe-boot/templates/tftp/tftpboot/grub.cfg.j2 | 6 +++--- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/metal/roles/pxe-boot/defaults/main.yml b/metal/roles/pxe-boot/defaults/main.yml index 0250a5e3..f06d747d 100644 --- a/metal/roles/pxe-boot/defaults/main.yml +++ b/metal/roles/pxe-boot/defaults/main.yml @@ -3,3 +3,4 @@ iso_checksum: "sha256:acbf3cd5b25da7a1fb6862485a6a38064dd8f14dc0398137d371abb9b1 iso_file_name: "fedora-coreos-34.20210518.3.0-live.x86_64.iso" os_username: admin +os_name: CoreOS diff --git a/metal/roles/pxe-boot/templates/docker-compose.yml b/metal/roles/pxe-boot/templates/docker-compose.yml index 3f4da50e..b9848b64 100644 --- a/metal/roles/pxe-boot/templates/docker-compose.yml +++ b/metal/roles/pxe-boot/templates/docker-compose.yml @@ -9,12 +9,20 @@ services: network_mode: host volumes: - ./mnt/EFI/BOOT/grubx64.efi:/var/lib/tftpboot/grubx64.efi + - ./mnt/images/ignition.img:/var/lib/tftpboot/ignition.img - ./mnt/images/pxeboot/initrd.img:/var/lib/tftpboot/initrd.img - ./mnt/images/pxeboot/vmlinuz:/var/lib/tftpboot/vmlinuz http: build: ./http network_mode: host volumes: - - ./mnt:/usr/share/nginx/html/Fedora + - ./mnt:/usr/share/nginx/html/CoreOS + - ./http/ignition/:/usr/share/nginx/html/ignition environment: NGINX_PORT: 80 + butane: + image: quay.io/coreos/butane:release + volumes: + - ./http/ignition/:/local/src + working_dir: /local/src + command: --pretty --strict ignition.yaml --output ignition.json diff --git a/metal/roles/pxe-boot/templates/http/Dockerfile b/metal/roles/pxe-boot/templates/http/Dockerfile index c90eeb7d..990f0065 100644 --- a/metal/roles/pxe-boot/templates/http/Dockerfile +++ b/metal/roles/pxe-boot/templates/http/Dockerfile @@ -1,3 +1 @@ FROM nginx:1.19-alpine - -COPY ./kickstart /usr/share/nginx/html/kickstart diff --git a/metal/roles/pxe-boot/templates/tftp/tftpboot/grub.cfg.j2 b/metal/roles/pxe-boot/templates/tftp/tftpboot/grub.cfg.j2 index f40b8ea1..611afc86 100644 --- a/metal/roles/pxe-boot/templates/tftp/tftpboot/grub.cfg.j2 +++ b/metal/roles/pxe-boot/templates/tftp/tftpboot/grub.cfg.j2 @@ -1,11 +1,11 @@ set timeout=1 -menuentry 'CoreOS (Live)' { +menuentry '{{ os_name }} (Live)' { linux vmlinuz \ ip=dhcp \ ignition.platform.id=metal \ - coreos.live.rootfs_url=http://{{ ansible_default_ipv4.address }}/Fedora/images/pxeboot/rootfs.img \ + coreos.live.rootfs_url=http://{{ ansible_default_ipv4.address }}/{{ os_name }}/images/pxeboot/rootfs.img \ coreos.inst.install_dev=/dev/{{ disk }} \ - coreos.inst.ignition_url=http://{{ ansible_default_ipv4.address }}/kickstart/init.json + coreos.inst.ignition_url=http://{{ ansible_default_ipv4.address }}/ignition/ignition.json initrd initrd.img ignition.img }