Commit 68ebe783 authored by nanahira's avatar nanahira

add domain and fix kms

parent 672f512a
...@@ -16,25 +16,41 @@ no-dhcp-interface=lo{% for br in bridges %}{% if not br.dhcp is defined or not b ...@@ -16,25 +16,41 @@ no-dhcp-interface=lo{% for br in bridges %}{% if not br.dhcp is defined or not b
{% for br in bridges %} {% for br in bridges %}
{% if br.dhcp is defined and br.dhcp %} {% if br.dhcp is defined and br.dhcp %}
# DHCP for {{br.name}}
dhcp-range={{br.name}},{{br.dhcp.start}},{{br.dhcp.end}},{{br.dhcp.time}} dhcp-range={{br.name}},{{br.dhcp.start}},{{br.dhcp.end}},{{br.dhcp.time}}
{% if br.dhcp.domain is defined and br.dhcp.domain %}
{% if br.dhcpv6Receive is defined and br.dhcpv6Receive %} ## Domain {{br.dhcp.domain}} specified
dhcp-range=tag:{{br.name}},::,constructor:{{br.name}},ra-names,24h domain={{br.dhcp.domain}},{{br.address}},local
{% if dnsmasq.kms is defined and dnsmasq.kms %}
### KMS
{% if dnsmasq.kms != "localhost" %}
#### Using self-hosted KMS
srv-host=_vlmcs._tcp.{{br.dhcp.domain}},{{dnsmasq.kms}},1688,0,100
{% else %}
#### Using in-built KMS
srv-host=_vlmcs._tcp.{{br.dhcp.domain}},{{services.address}},1688,0,100
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endfor %} {% else %}
## Domain not specified, using default domain {{br.name | regex_replace('^(vm)?br', '')}}.lan
domain={{br.name | regex_replace('^(vm)?br', '')}}.lan,{{br.address}},local
{% if dnsmasq.kms is defined and dnsmasq.kms %} {% if dnsmasq.kms is defined and dnsmasq.kms %}
# KMS ### KMS
{% if dnsmasq.kms != "localhost" %} {% if dnsmasq.kms != "localhost" %}
srv-host=_vlmcs._tcp,{{dnsmasq.kms}},1688,0,100 #### Using self-hosted KMS
srv-host=_vlmcs._tcp.lan,{{dnsmasq.kms}},1688,0,100 srv-host=_vlmcs._tcp.{{br.name | regex_replace('^(vm)?br', '')}}.lan,{{dnsmasq.kms}},1688,0,100
{% else %} {% else %}
srv-host=_vlmcs._tcp,{{services.address}},1688,0,100 #### Using in-built KMS
srv-host=_vlmcs._tcp.lan,{{services.address}},1688,0,100 srv-host=_vlmcs._tcp.{{br.name | regex_replace('^(vm)?br', '')}}.lan,{{services.address}},1688,0,100
{% endif %}
{% endif %}
{% endif %}
{% if br.dhcpv6Receive is defined and br.dhcpv6Receive %}
dhcp-range=tag:{{br.name}},::,constructor:{{br.name}},ra-names,24h
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endfor %}
{% if dnsmasq.aptCacher is defined and dnsmasq.aptCacher %} {% if dnsmasq.aptCacher is defined and dnsmasq.aptCacher %}
# apt cacher # apt cacher
......
...@@ -40,6 +40,7 @@ vars: ...@@ -40,6 +40,7 @@ vars:
start: 10.0.0.100 start: 10.0.0.100
end: 10.0.0.240 end: 10.0.0.240
time: 48h time: 48h
domain: lan # 该段的缺省域名,默认为 br 的名称
- name: brwan - name: brwan
links: links:
- bond0.2 - bond0.2
......
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