From 39e6e652018a5770c29b4543e11a516052512a98 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Thu, 9 Nov 2017 10:04:23 +0000 Subject: [PATCH] docs: add mustach sample files Include samples to installation, and give a hint to user where it can be found in manual page. Signed-off-by: Sami Kerola --- Makefile.am | 2 + man/dhcpd-pools.1.in | 3 + samples/Makemodule.am | 4 + samples/dhcpd.conf | 31 ++++++ samples/dhcpd.leases | 210 +++++++++++++++++++++++++++++++++++++++ samples/mustach.template | 44 ++++++++ 6 files changed, 294 insertions(+) create mode 100644 samples/Makemodule.am create mode 100644 samples/dhcpd.conf create mode 100644 samples/dhcpd.leases create mode 100644 samples/mustach.template diff --git a/Makefile.am b/Makefile.am index 0daa8bf..b1f14be 100644 --- a/Makefile.am +++ b/Makefile.am @@ -35,6 +35,7 @@ edit_cmd = sed \ -e 's|@SHELL[@]|$(SHELL)|g' \ -e 's|@VERSION[@]|$(VERSION)|g' \ -e 's|@bindir[@]|$(bindir)|g' \ + -e 's|@docdir[@]|$(docdir)|g' \ -e 's|@top_srcdir[@]|$(top_srcdir)|g' $(PATHFILES): Makefile @@ -48,6 +49,7 @@ $(PATHFILES): Makefile include contrib/Makemodule.am include doc/Makemodule.am include man/Makemodule.am +include samples/Makemodule.am include src/Makemodule.am include tests/Makemodule.am diff --git a/man/dhcpd-pools.1.in b/man/dhcpd-pools.1.in index 935b1c0..e5f014e 100644 --- a/man/dhcpd-pools.1.in +++ b/man/dhcpd-pools.1.in @@ -111,6 +111,9 @@ file. Mustache tags in the template are same as json output without IP address information. When the native output formats controlled with .B \-\-format option do not provide what you need you should use mustach instead. +.IP +@bindir@/dhcpd-pools --config @docdir@/dhcpd.conf --leases +@docdir@/dhcpd.leases --mustach @docdir@/mustach.template .TP \fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR .I File diff --git a/samples/Makemodule.am b/samples/Makemodule.am new file mode 100644 index 0000000..2d1bddd --- /dev/null +++ b/samples/Makemodule.am @@ -0,0 +1,4 @@ +dist_doc_DATA = \ + samples/dhcpd.conf \ + samples/dhcpd.leases \ + samples/mustach.template diff --git a/samples/dhcpd.conf b/samples/dhcpd.conf new file mode 100644 index 0000000..0ef9eb0 --- /dev/null +++ b/samples/dhcpd.conf @@ -0,0 +1,31 @@ +shared-network example1 { + subnet 10.0.0.0 netmask 255.255.255.0 { + pool { + range 10.0.0.1 10.0.0.20; + } + } + subnet 10.1.0.0 netmask 255.255.255.0 { + pool { + range 10.1.0.1 10.1.0.20; + } + } +} + +shared-network example2 { + subnet 10.2.0.0 netmask 255.255.255.0 { + pool { + range 10.2.0.1 10.2.0.20; + } + } + subnet 10.3.0.0 netmask 255.255.255.0 { + pool { + range 10.3.0.1 10.3.0.20; + } + } +} + +subnet 10.4.0.0 netmask 255.255.255.0 { + pool { + range 10.4.0.1 10.4.0.20; + } +} diff --git a/samples/dhcpd.leases b/samples/dhcpd.leases new file mode 100644 index 0000000..0d7e317 --- /dev/null +++ b/samples/dhcpd.leases @@ -0,0 +1,210 @@ +lease 10.0.0.0 { + binding state active; + hardware ethernet 00:00:00:00:00:00; +} +lease 10.0.0.1 { + binding state active; + hardware ethernet 00:00:00:00:00:01; +} +lease 10.0.0.2 { + binding state active; + hardware ethernet 00:00:00:00:00:02; +} +lease 10.0.0.3 { + binding state active; + hardware ethernet 00:00:00:00:00:03; +} +lease 10.0.0.4 { + binding state active; + hardware ethernet 00:00:00:00:00:04; +} +lease 10.0.0.5 { + binding state active; + hardware ethernet 00:00:00:00:00:05; +} +lease 10.0.0.6 { + binding state active; + hardware ethernet 00:00:00:00:00:06; +} +lease 10.0.0.7 { + binding state active; + hardware ethernet 00:00:00:00:00:07; +} +lease 10.0.0.8 { + binding state active; + hardware ethernet 00:00:00:00:00:08; +} +lease 10.0.0.9 { + binding state active; + hardware ethernet 00:00:00:00:00:09; +} +lease 10.0.0.10 { + binding state active; + hardware ethernet 00:00:00:00:00:10; +} +lease 10.0.0.11 { + binding state active; + hardware ethernet 00:00:00:00:00:11; +} +lease 10.0.0.12 { + binding state backup; + hardware ethernet 00:00:00:00:00:12; +} + + +lease 10.1.0.0 { + binding state active; + hardware ethernet 00:00:00:00:01:00; +} +lease 10.1.0.1 { + binding state active; + hardware ethernet 00:00:00:00:01:01; +} +lease 10.1.0.2 { + binding state active; + hardware ethernet 00:00:00:00:01:02; +} +lease 10.1.0.3 { + binding state active; + hardware ethernet 00:00:00:00:01:03; +} +lease 10.1.0.4 { + binding state active; + hardware ethernet 00:00:00:00:01:04; +} +lease 10.1.0.5 { + binding state active; + hardware ethernet 00:00:00:00:01:05; +} +lease 10.1.0.6 { + binding state active; + hardware ethernet 00:00:00:00:01:06; +} +lease 10.1.0.7 { + binding state active; + hardware ethernet 00:00:00:00:01:07; +} +lease 10.1.0.8 { + binding state active; + hardware ethernet 00:00:00:00:01:08; +} +lease 10.1.0.9 { + binding state active; + hardware ethernet 00:00:00:00:01:09; +} +lease 10.1.0.10 { + binding state active; + hardware ethernet 00:00:00:00:01:10; +} + + +lease 10.2.0.0 { + binding state active; + hardware ethernet 00:00:00:00:02:00; +} +lease 10.2.0.1 { + binding state active; + hardware ethernet 00:00:00:00:02:01; +} +lease 10.2.0.2 { + binding state active; + hardware ethernet 00:00:00:00:02:02; +} +lease 10.2.0.3 { + binding state active; + hardware ethernet 00:00:00:00:02:03; +} +lease 10.2.0.4 { + binding state active; + hardware ethernet 00:00:00:00:02:04; +} +lease 10.2.0.5 { + binding state active; + hardware ethernet 00:00:00:00:02:05; +} +lease 10.2.0.6 { + binding state active; + hardware ethernet 00:00:00:00:02:06; +} +lease 10.2.0.7 { + binding state active; + hardware ethernet 00:00:00:00:02:07; +} +lease 10.2.0.8 { + binding state active; + hardware ethernet 00:00:00:00:02:08; +} + +lease 10.3.0.0 { + binding state active; + hardware ethernet 00:00:00:00:03:00; +} +lease 10.3.0.1 { + binding state active; + hardware ethernet 00:00:00:00:03:01; +} +lease 10.3.0.2 { + binding state active; + hardware ethernet 00:00:00:00:03:02; +} +lease 10.3.0.3 { + binding state active; + hardware ethernet 00:00:00:00:03:03; +} +lease 10.3.0.4 { + binding state active; + hardware ethernet 00:00:00:00:03:04; +} +lease 10.3.0.5 { + binding state active; + hardware ethernet 00:00:00:00:03:05; +} +lease 10.3.0.6 { + binding state active; + hardware ethernet 00:00:00:00:03:06; +} +lease 10.3.0.7 { + binding state active; + hardware ethernet 00:00:00:00:03:07; +} +lease 10.3.0.8 { + binding state active; + hardware ethernet 00:00:00:00:03:08; +} +lease 10.3.0.9 { + binding state active; + hardware ethernet 00:00:00:00:03:09; +} +lease 10.3.0.9 { + binding state active; + hardware ethernet 00:00:00:00:03:09; +} + +lease 10.4.0.0 { + binding state active; + hardware ethernet 00:00:00:00:04:00; +} +lease 10.4.0.1 { + binding state active; + hardware ethernet 00:00:00:00:04:01; +} +lease 10.4.0.2 { + binding state active; + hardware ethernet 00:00:00:00:04:02; +} +lease 10.4.0.3 { + binding state active; + hardware ethernet 00:00:00:00:04:03; +} +lease 10.4.0.4 { + binding state active; + hardware ethernet 00:00:00:00:04:04; +} +lease 10.4.0.5 { + binding state active; + hardware ethernet 00:00:00:00:04:05; +} +lease 10.4.0.6 { + binding state backup; + hardware ethernet 00:00:00:00:04:06; +} diff --git a/samples/mustach.template b/samples/mustach.template new file mode 100644 index 0000000..f8582c3 --- /dev/null +++ b/samples/mustach.template @@ -0,0 +1,44 @@ +Subnets:{{#subnets}} + location: {{location}} + range: {{range}} + first_ip: {{first_ip}} + last_ip: {{last_ip}} + used: {{used}} + touched: {{touched}} + defined: {{defined}} + free: {{free}} + percent: {{percent}} + touch_count: {{touch_count}} + touch_percent: {{touch_percent}} + backup_count: {{backup_count}} + backup_percent: {{backup_percent}} + status: {{status}} +{{/subnets}} + +Shared-networks:{{#shared-networks}} + location: {{location}} + defined: {{defined}} + used: {{used}} + touched: {{touched}} + free: {{free}} + percent: {{percent}} + touch_count: {{touch_count}} + touch_percent: {{touch_percent}} + backup_count: {{backup_count}} + backup_percent: {{backup_percent}} + status: {{status}} +{{/shared-networks}} + +Summary:{{#summary}} + location: {{location}} + defined: {{defined}} + used: {{used}} + touched: {{touched}} + free: {{free}} + percent: {{percent}} + touch_count: {{touch_count}} + touch_percent: {{touch_percent}} + backup_count: {{backup_count}} + backup_percent: {{backup_percent}} + status: {{status}} +{{/summary}}