add omapi key support
diff --git a/README.md b/README.md
index 7d195aa..ab08075 100644
--- a/README.md
+++ b/README.md
@@ -4,12 +4,13 @@
## Sample pillars
-ISC DHCP server
+ISC DHCP server with defined host and subnet (client must use the same key)
isc_dhcp:
server:
enabled: true
omapi_port: 7911
+ omapi_key: iFdQ0kvpUo+3gzXGJTpjk7/dl9DI5SuDqMzasDUhBRGEg6VfNYUX+MAU14WoJJZDQbrvC4Pgsdfdsfdsfdsdf==
authoritative: true
interfaces:
- name: eth0
@@ -22,7 +23,15 @@
mac: 00:11:22:33:44:55:66
address: 192.168.0.1
hostname: domain.com
+ subnet:
+ testsubnet:
+ range: 10.0.0.1 10.0.0.100
+ netmask: 255.255.255.0
+ network: 10.0.0.0
+ pxeserver: 10.1.1.1
+
+
## Read more
-* http://chschneider.eu/linux/server/tftpd-hpa.shtml
\ No newline at end of file
+* http://chschneider.eu/linux/server/tftpd-hpa.shtml
diff --git a/isc_dhcp/files/dhcpd.conf b/isc_dhcp/files/dhcpd.conf
index ec97e4c..8cfe205 100644
--- a/isc_dhcp/files/dhcpd.conf
+++ b/isc_dhcp/files/dhcpd.conf
@@ -5,6 +5,14 @@
omapi-port {{ server.omapi_port }};
{% endif -%}
+{- if server.omapi_key and server.omapi_port is defined %}
+key omapi_key {
+ algorithm HMAC-MD5;
+ secret "{{ server.omapi_key }}";
+};
+omapi-key omapi_key;
+{%- endif %}
+
{%- if server.ddns_updates is defined %}
ddns-updates on;
@@ -91,4 +99,4 @@
include "{{ server.config_dir }}/dhcpd.hosts";
include "{{ server.config_dir }}/dhcpd.subnets";
-{%- endif %}
\ No newline at end of file
+{%- endif %}