From 491c8c701fcefa0166251c845522a53b4adbcb68 Mon Sep 17 00:00:00 2001 From: Paolo Asperti Date: Thu, 26 Oct 2023 23:31:46 +0200 Subject: [PATCH] playbook ansible WIP --- roles/pxeserver/tasks/ipxe.yml | 31 +++++++++++++++++++++++++++ roles/pxeserver/tasks/main.yml | 1 + roles/pxeserver/templates/dnsmasq/pxe | 5 +++++ 3 files changed, 37 insertions(+) create mode 100644 roles/pxeserver/tasks/ipxe.yml create mode 100644 roles/pxeserver/templates/dnsmasq/pxe diff --git a/roles/pxeserver/tasks/ipxe.yml b/roles/pxeserver/tasks/ipxe.yml new file mode 100644 index 0000000..46ec923 --- /dev/null +++ b/roles/pxeserver/tasks/ipxe.yml @@ -0,0 +1,31 @@ +--- + +- name: IPXE dnsmasq + template: + src: dnsmasq/pxe + dest: /etc/dnsmasq.d/pxe + owner: root + group: root + mode: "0644" + become: true + +- name: IPXE bios firmware + ansible.builtin.file: + src: /usr/lib/ipxe/undionly.kpxe + dest: /srv/tftp/undionly.kpxe + state: link + become: true + +- name: IPXE efi firmware + ansible.builtin.file: + src: /usr/lib/ipxe/ipxe.efi + dest: /srv/tftp/ipxe.efi + state: link + become: true + +- name: IPXE memdisk + ansible.builtin.file: + src: /usr/lib/syslinux/memdisk + dest: /srv/pxe/memdisk + state: link + become: true diff --git a/roles/pxeserver/tasks/main.yml b/roles/pxeserver/tasks/main.yml index 696594e..5196f0e 100644 --- a/roles/pxeserver/tasks/main.yml +++ b/roles/pxeserver/tasks/main.yml @@ -6,3 +6,4 @@ - include: nfs.yml - include: firewall.yml - include: iso.yml +- include: ipxe.yml diff --git a/roles/pxeserver/templates/dnsmasq/pxe b/roles/pxeserver/templates/dnsmasq/pxe new file mode 100644 index 0000000..6f80904 --- /dev/null +++ b/roles/pxeserver/templates/dnsmasq/pxe @@ -0,0 +1,5 @@ +dhcp-match=set:bios,option:client-arch,0 +dhcp-boot=tag:bios,undionly.kpxe +dhcp-boot=tag:!bios,ipxe.efi +dhcp-match=ipxe,175 +dhcp-boot=net:ipxe,http://{{ lan_ip }}/boot.txt