Python3: PIP requirement
[csit.git] / resources / tools / testbed-setup / ansible / roles / cobbler / files / etc / cobbler / dhcp.template
1 # ******************************************************************
2 # Cobbler managed dhcpd.conf file
3 #
4 # generated from cobbler dhcp.conf template ($date)
5 # Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
6 # in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
7 # overwritten.
8 #
9 # ******************************************************************
10
11 ddns-update-style interim;
12
13 allow booting;
14 allow bootp;
15
16 ignore client-updates;
17 set vendorclass = option vendor-class-identifier;
18
19 option pxe-system-type code 93 = unsigned integer 16;
20
21 subnet 10.30.51.0 netmask 255.255.255.0 {
22      option routers             10.30.51.1;
23      option domain-name         "linuxfoundation.org";
24      option domain-name-servers 1.1.1.1, 8.8.8.8;
25      option subnet-mask         255.255.255.0;
26      range dynamic-bootp        10.30.51.2 10.30.51.254;
27      default-lease-time         600;
28      max-lease-time             7200;
29      next-server                $next_server;
30      class "pxeclients" {
31           match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
32           if option pxe-system-type = 00:02 {
33                   filename "ia64/elilo.efi";
34           } else if option pxe-system-type = 00:06 {
35                   filename "grub/grub-x86.efi";
36           } else if option pxe-system-type = 00:07 {
37                   filename "grub/grub-x86_64.efi";
38           } else {
39                   filename "pxelinux.0";
40           }
41      }
42 }
43
44 #for dhcp_tag in $dhcp_tags.keys():
45     ## group could be subnet if your dhcp tags line up with your subnets
46     ## or really any valid dhcpd.conf construct ... if you only use the
47     ## default dhcp tag in cobbler, the group block can be deleted for a
48     ## flat configuration
49 # group for Cobbler DHCP tag: $dhcp_tag
50 group {
51         #for mac in $dhcp_tags[$dhcp_tag].keys():
52             #set iface = $dhcp_tags[$dhcp_tag][$mac]
53     host $iface.name {
54         hardware ethernet $mac;
55         #if $iface.ip_address:
56         fixed-address $iface.ip_address;
57         #end if
58         #if $iface.hostname:
59         option host-name "$iface.hostname";
60         #end if
61         #if $iface.netmask:
62         option subnet-mask $iface.netmask;
63         #end if
64         #if $iface.gateway:
65         option routers $iface.gateway;
66         #end if
67         #if $iface.enable_gpxe:
68         if exists user-class and option user-class = "gPXE" {
69             filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
70         } else if exists user-class and option user-class = "iPXE" {
71             filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
72         } else {
73             filename "undionly.kpxe";
74         }
75         #else
76         filename "$iface.filename";
77         #end if
78         ## Cobbler defaults to $next_server, but some users
79         ## may like to use $iface.system.server for proxied setups
80         next-server $next_server;
81         ## next-server $iface.next_server;
82     }
83         #end for
84 }
85 #end for
86