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 <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2017-11-09 10:04:23 +00:00
parent 74fdf90980
commit 39e6e65201
No known key found for this signature in database
GPG key ID: A9553245FDE9B739
6 changed files with 294 additions and 0 deletions

View file

@ -35,6 +35,7 @@ edit_cmd = sed \
-e 's|@SHELL[@]|$(SHELL)|g' \ -e 's|@SHELL[@]|$(SHELL)|g' \
-e 's|@VERSION[@]|$(VERSION)|g' \ -e 's|@VERSION[@]|$(VERSION)|g' \
-e 's|@bindir[@]|$(bindir)|g' \ -e 's|@bindir[@]|$(bindir)|g' \
-e 's|@docdir[@]|$(docdir)|g' \
-e 's|@top_srcdir[@]|$(top_srcdir)|g' -e 's|@top_srcdir[@]|$(top_srcdir)|g'
$(PATHFILES): Makefile $(PATHFILES): Makefile
@ -48,6 +49,7 @@ $(PATHFILES): Makefile
include contrib/Makemodule.am include contrib/Makemodule.am
include doc/Makemodule.am include doc/Makemodule.am
include man/Makemodule.am include man/Makemodule.am
include samples/Makemodule.am
include src/Makemodule.am include src/Makemodule.am
include tests/Makemodule.am include tests/Makemodule.am

View file

@ -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 address information. When the native output formats controlled with
.B \-\-format .B \-\-format
option do not provide what you need you should use mustach instead. 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 .TP
\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR \fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR
.I File .I File

4
samples/Makemodule.am Normal file
View file

@ -0,0 +1,4 @@
dist_doc_DATA = \
samples/dhcpd.conf \
samples/dhcpd.leases \
samples/mustach.template

31
samples/dhcpd.conf Normal file
View file

@ -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;
}
}

210
samples/dhcpd.leases Normal file
View file

@ -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;
}

44
samples/mustach.template Normal file
View file

@ -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}}