summaryrefslogtreecommitdiff
path: root/roles/network/dhcp-server
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-12-22 01:02:25 +0100
committerChristian Pointner <equinox@spreadspace.org>2021-12-22 01:02:25 +0100
commit768ecbc2c5689ab6f84407ff189abcb7acc9e0ef (patch)
treee7ba0063b7a2e176cd83bc4358b40ca0e63dc108 /roles/network/dhcp-server
parentadd wakup script to jump host (diff)
make dhcp-server role a little bit more flexible
Diffstat (limited to 'roles/network/dhcp-server')
-rw-r--r--roles/network/dhcp-server/tasks/main.yml6
1 files changed, 6 insertions, 0 deletions
diff --git a/roles/network/dhcp-server/tasks/main.yml b/roles/network/dhcp-server/tasks/main.yml
index 43851d37..f8733029 100644
--- a/roles/network/dhcp-server/tasks/main.yml
+++ b/roles/network/dhcp-server/tasks/main.yml
@@ -19,9 +19,15 @@
{% for interface,subnet in dhcp_server_interfaces.items() %}
subnet {{ subnet.prefix | ipaddr('network') }} netmask {{ subnet.prefix | ipaddr('netmask') }} {
range {{ subnet.prefix | ipaddr(subnet.start) | ipaddr('address') }} {{ subnet.prefix | ipaddr(subnet.limit) | ipaddr('address') }};
+ {% if 'gateway' in subnet %}
option routers {{ subnet.gateway }};
+ {% endif %}
+ {% if 'dns' in subnet %}
option domain-name-servers {{ subnet.dns | join(', ') }};
+ {% endif %}
+ {% if 'domain' in subnet %}
option domain-name "{{ subnet.domain }}";
+ {% endif %}
}
{% if not loop.last %}