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 ...@@ -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 %} {% if dnsmasq.pxe is defined and dnsmasq.pxe %}
# PXE # PXE
{% if dnsmasq.pxe != "localhost" %} ## detect PXE type
dhcp-match=set:bios,60,PXEClient:Arch:00000 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-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-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-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-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 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}} dhcp-boot=tag:efi64-2,netboot.xyz.efi,,{{dnsmasq.pxe}}
{% else %} {% else %}
dhcp-match=set:bios,60,PXEClient:Arch:00000 {% for br in bridges %}
dhcp-boot=tag:bios,netboot.xyz.kpxe,,{{services.address}} {% if br.dhcp is defined and br.dhcp %}
dhcp-match=set:efi32,60,PXEClient:Arch:00002 ## PXE server for {{br.name}}
dhcp-boot=tag:efi32,netboot.xyz.efi,,{{services.address}} tag-if=tag:{{br.name}},tag:bios,set:bios-{{br.name}}
dhcp-match=set:efi32-1,60,PXEClient:Arch:00006 tag-if=tag:{{br.name}},tag:efi32,set:efi32-{{br.name}}
dhcp-boot=tag:efi32-1,netboot.xyz.efi,,{{services.address}} tag-if=tag:{{br.name}},tag:efi32-1,set:efi32-1-{{br.name}}
dhcp-match=set:efi64,60,PXEClient:Arch:00007 tag-if=tag:{{br.name}},tag:efi64,set:efi64-{{br.name}}
dhcp-boot=tag:efi64,netboot.xyz.efi,,{{services.address}} tag-if=tag:{{br.name}},tag:efi64-1,set:efi64-1-{{br.name}}
dhcp-match=set:efi64-1,60,PXEClient:Arch:00008 tag-if=tag:{{br.name}},tag:efi64-2,set:efi64-2-{{br.name}}
dhcp-boot=tag:efi64-1,netboot.xyz.efi,,{{services.address}} dhcp-boot=tag:bios-{{br.name}},netboot.xyz.kpxe,,{{ br.address | regex_replace("/\d+$", "") }}
dhcp-match=set:efi64-2,60,PXEClient:Arch:00009 dhcp-boot=tag:efi32-{{br.name}},netboot.xyz.efi,,{{ br.address | regex_replace("/\d+$", "") }}
dhcp-boot=tag:efi64-2,netboot.xyz.efi,,{{services.address}} 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 %}
{% endif %} {% endif %}
...@@ -40,7 +40,11 @@ services: ...@@ -40,7 +40,11 @@ services:
PUID: {{ansible_user_uid}} PUID: {{ansible_user_uid}}
PGID: {{ansible_user_gid}} PGID: {{ansible_user_gid}}
ports: 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' - '{{services.address}}:16980:80'
volumes: volumes:
- ./pxe/data:/assets:ro - ./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