This file is indexed.

/usr/lib/python3/dist-packages/provisioningserver/templates/dhcp/dhcpd.conf.template is in python3-maas-provisioningserver 2.0.0~beta3+bzr4941-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# WARNING: Do not edit /var/lib/maas/dhcpd.conf yourself.  MAAS will
# overwrite any changes made there.  Instead, you can modify dhcpd.conf by
# using DHCP snippets over the API or through the web interface.

option arch code 93 = unsigned integer 16; # RFC4578
option path-prefix code 210 = text; #RFC5071

#
# Global DHCP snippets
#
{{for global_dhcp_snippet in global_dhcp_snippets}}
# Name: {{global_dhcp_snippet['name']}}
{{if global_dhcp_snippet['description'] != ''}}
# Description: {{global_dhcp_snippet['description'].replace('\n', ' ').replace('\r', '')}}
{{endif}}
{{global_dhcp_snippet['value']}}
{{endfor}}

#
# Bootloaders
#
{{bootloader}}

#
# Failover Peers
#
{{for failover_peer in failover_peers}}
failover peer "{{failover_peer["name"]}}" {
    {{failover_peer["mode"]}};
    address {{failover_peer["address"]}};
    peer address {{failover_peer["peer_address"]}};
    max-response-delay 60;
    max-unacked-updates 10;
    load balance max seconds 3;
    {{if failover_peer["mode"] == "primary"}}
    mclt 3600;
    split 255;
    {{endif}}
}
{{endfor}}

#
# Networks
#
{{for shared_network in shared_networks}}
shared-network {{shared_network["name"]}} {
    {{for dhcp_subnet in shared_network["subnets"]}}
    subnet {{dhcp_subnet['subnet']}} netmask {{dhcp_subnet['subnet_mask']}} {
           ignore-client-uids true;
           option subnet-mask {{dhcp_subnet['subnet_mask']}};
           option broadcast-address {{dhcp_subnet['broadcast_ip']}};
           {{if dhcp_subnet.get('dns_servers')}}
           option domain-name-servers {{dhcp_subnet['dns_servers']}};
           {{endif}}
           option domain-name "{{dhcp_subnet['domain_name']}}";
           {{if dhcp_subnet['router_ip'] }}
           option routers {{dhcp_subnet['router_ip']}};
           {{endif}}
           {{if dhcp_subnet.get('ntp_server')}}
           option ntp-servers {{dhcp_subnet['ntp_server']}};
           {{endif}}
           default-lease-time 600;
           max-lease-time 600;
           #
           # Subnet DHCP snippets
           #
           {{for dhcp_snippet in dhcp_subnet['dhcp_snippets']}}
           # Name: {{dhcp_snippet['name']}}
           {{if dhcp_snippet['description'] != ''}}
           # Description: {{dhcp_snippet['description'].replace('\n', ' ').replace('\r', '')}}
           {{endif}}
           {{dhcp_snippet['value']}}
           {{endfor}}

           class "PXE" {
              match if substring (option vendor-class-identifier, 0, 3) = "PXE";
              default-lease-time 30;
              max-lease-time 30;
           }

           {{for pool in dhcp_subnet['pools']}}
           pool {
              {{if pool.get('failover_peer')}}
              failover peer "{{pool['failover_peer']}}";
              {{endif}}
              range {{pool['ip_range_low']}} {{pool['ip_range_high']}};
           }
           {{endfor}}
    }
    {{endfor}}
}
{{endfor}}

#
# Hosts
#
{{for host in hosts}}
# {{host['host']}}
host {{host['mac'].replace(":", "-")}} {
   #
   # Node DHCP snippets
   #
   {{for dhcp_snippet in host['dhcp_snippets']}}
   # Name: {{dhcp_snippet['name']}}
   {{if dhcp_snippet['description'] != ''}}
   # Description: {{dhcp_snippet['description'].replace('\n', ' ').replace('\r', '')}}
   {{endif}}
   {{dhcp_snippet['value']}}
   {{endfor}}

   hardware ethernet {{host['mac']}};
   fixed-address {{host['ip']}};
}
{{endfor}}

#
# Notify MAAS
#
on commit {
   set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
   set clip = binary-to-ascii(10, 8, ".", leased-address);
   set cllt = binary-to-ascii(10, 32, "", encode-int(lease-time, 32));
   set clht = pick-first-value(option host-name, "(none)");
   execute(
       "/usr/sbin/maas-dhcp-helper", "notify",
       "--action", "commit", "--mac", clhw,
       "--ip-family", "ipv4", "--ip", clip,
       "--lease-time", cllt, "--hostname", clht);
}
on expiry {
   set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
   set clip = binary-to-ascii(10, 8, ".", leased-address);
   execute(
       "/usr/sbin/maas-dhcp-helper", "notify",
       "--action", "expiry", "--mac", clhw,
       "--ip-family", "ipv4", "--ip", clip);
}
on release {
   set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
   set clip = binary-to-ascii(10, 8, ".", leased-address);
   execute(
       "/usr/sbin/maas-dhcp-helper", "notify",
       "--action", "release", "--mac", clhw,
       "--ip-family", "ipv4", "--ip", clip);
}

omapi-port 7911;
key omapi_key {
    algorithm HMAC-MD5;
    secret "{{omapi_key}}";
};
omapi-key omapi_key;