Commit 4f65c6d8 authored by nanahira's avatar nanahira

fix pxe

parent a5f84af4
......@@ -48,31 +48,38 @@ host-record=security.ubuntu.com,deb.debian.org,security.debian.org,{{services.ad
{% if dnsmasq.pxe is defined and dnsmasq.pxe %}
# PXE
{% if dnsmasq.pxe != "localhost" %}
## detect PXE type
dhcp-match=set:bios,60,PXEClient:Arch:00000
dhcp-boot=tag:bios,netboot.xyz.kpxe,,{{dnsmasq.pxe}}
dhcp-match=set:efi32,60,PXEClient:Arch:00002
dhcp-boot=tag:efi32,netboot.xyz.efi,,{{dnsmasq.pxe}}
dhcp-match=set:efi32-1,60,PXEClient:Arch:00006
dhcp-boot=tag:efi32-1,netboot.xyz.efi,,{{dnsmasq.pxe}}
dhcp-match=set:efi64,60,PXEClient:Arch:00007
dhcp-boot=tag:efi64,netboot.xyz.efi,,{{dnsmasq.pxe}}
dhcp-match=set:efi64-1,60,PXEClient:Arch:00008
dhcp-boot=tag:efi64-1,netboot.xyz.efi,,{{dnsmasq.pxe}}
dhcp-match=set:efi64-2,60,PXEClient:Arch:00009
{% if dnsmasq.pxe != "localhost" %}
## remote PXE server
dhcp-boot=tag:bios,netboot.xyz.kpxe,,{{dnsmasq.pxe}}
dhcp-boot=tag:efi32,netboot.xyz.efi,,{{dnsmasq.pxe}}
dhcp-boot=tag:efi32-1,netboot.xyz.efi,,{{dnsmasq.pxe}}
dhcp-boot=tag:efi64,netboot.xyz.efi,,{{dnsmasq.pxe}}
dhcp-boot=tag:efi64-1,netboot.xyz.efi,,{{dnsmasq.pxe}}
dhcp-boot=tag:efi64-2,netboot.xyz.efi,,{{dnsmasq.pxe}}
{% else %}
dhcp-match=set:bios,60,PXEClient:Arch:00000
dhcp-boot=tag:bios,netboot.xyz.kpxe,,{{services.address}}
dhcp-match=set:efi32,60,PXEClient:Arch:00002
dhcp-boot=tag:efi32,netboot.xyz.efi,,{{services.address}}
dhcp-match=set:efi32-1,60,PXEClient:Arch:00006
dhcp-boot=tag:efi32-1,netboot.xyz.efi,,{{services.address}}
dhcp-match=set:efi64,60,PXEClient:Arch:00007
dhcp-boot=tag:efi64,netboot.xyz.efi,,{{services.address}}
dhcp-match=set:efi64-1,60,PXEClient:Arch:00008
dhcp-boot=tag:efi64-1,netboot.xyz.efi,,{{services.address}}
dhcp-match=set:efi64-2,60,PXEClient:Arch:00009
dhcp-boot=tag:efi64-2,netboot.xyz.efi,,{{services.address}}
{% for br in bridges %}
{% if br.dhcp is defined and br.dhcp %}
## PXE server for {{br.name}}
tag-if=tag:{{br.name}},tag:bios,set:bios-{{br.name}}
tag-if=tag:{{br.name}},tag:efi32,set:efi32-{{br.name}}
tag-if=tag:{{br.name}},tag:efi32-1,set:efi32-1-{{br.name}}
tag-if=tag:{{br.name}},tag:efi64,set:efi64-{{br.name}}
tag-if=tag:{{br.name}},tag:efi64-1,set:efi64-1-{{br.name}}
tag-if=tag:{{br.name}},tag:efi64-2,set:efi64-2-{{br.name}}
dhcp-boot=tag:bios-{{br.name}},netboot.xyz.kpxe,,{{ br.address | regex_replace("/\d+$", "") }}
dhcp-boot=tag:efi32-{{br.name}},netboot.xyz.efi,,{{ br.address | regex_replace("/\d+$", "") }}
dhcp-boot=tag:efi32-1-{{br.name}},netboot.xyz.efi,,{{ br.address | regex_replace("/\d+$", "") }}
dhcp-boot=tag:efi64-{{br.name}},netboot.xyz.efi,,{{ br.address | regex_replace("/\d+$", "") }}
dhcp-boot=tag:efi64-1-{{br.name}},netboot.xyz.efi,,{{ br.address | regex_replace("/\d+$", "") }}
dhcp-boot=tag:efi64-2-{{br.name}},netboot.xyz.efi,,{{ br.address | regex_replace("/\d+$", "") }}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
......@@ -40,7 +40,11 @@ services:
PUID: {{ansible_user_uid}}
PGID: {{ansible_user_gid}}
ports:
- '69:69/udp'
{% for br in bridges %}
{% if br.dhcp is defined and br.dhcp %}
- '{{ br.address | regex_replace("/\d+$", "") }}:69:69/udp'
{% endif %}
{% endfor %}
- '{{services.address}}:16980:80'
volumes:
- ./pxe/data:/assets:ro
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment