diff options
author | Christian Pointner <equinox@spreadspace.org> | 2021-12-22 01:02:25 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2021-12-22 01:02:25 +0100 |
commit | 768ecbc2c5689ab6f84407ff189abcb7acc9e0ef (patch) | |
tree | e7ba0063b7a2e176cd83bc4358b40ca0e63dc108 /roles/network/dhcp-server/tasks | |
parent | add wakup script to jump host (diff) |
make dhcp-server role a little bit more flexible
Diffstat (limited to 'roles/network/dhcp-server/tasks')
-rw-r--r-- | roles/network/dhcp-server/tasks/main.yml | 6 |
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 %} |