Today I noticed that if Foreman couldn’t “read” the dhcpd.conf file it wouldn’t start up dhcp support on that smart proxy.
I wasn’t aware that foreman required access to dhcpd.conf files. Does Foreman actually parse/use this file or does it send api calls to dhcpd to add/remove clients? I’m having an issue with shared-networks and include files and wondering if this might be the cause.
The error in the foreman-proxy/proxy.log is
E, [2018-11-09T09:35:26.285121 3da0e9b8] ERROR -- : Subnet 10.0.10.0 could not found
Foreman and Proxy versions:
Foreman and Proxy plugin versions:
Does the /etc/foreman-proxy/settings.d/dhcp.yml subnets config have any relation to this ?
# subnets restricts the subnets queried to a subset, to reduce the query time.
# - 192.168.205.0/255.255.255.128
# - 192.168.205.128/255.255.255.128
That seems to imply it’s just to reduce query time.
Both. It parses all dhcpd.conf files to learn about subnets and then it goes to leases file and parse that as well to learn about all leases and reservations. We have rewritten the parser from scratch in 1.15+ it used to be just regular expressions now this is full parser, however it does not understand all semantics just what we want. Then it keeps the data in memory and uses inotify Linux mechanism to re-read the data when this is changed by ISC DHCP.
Changes are made via omshell command, the file changes are performed by the ISC DHCP daemon itself, proxy simply spawns the command and provide it correct values. If you turn on debug mode, you will see exactly how it talks to the omshell command.
We track several bugs in our parser, it was brand new in 1.15 and we were fixing some until 1.20. If you hit issues then look at history of this file and backport the fixes into your instance or simply upgrade to 1.20:
This is basically whitelist, if you set this proxy will ignore other subnets to keep it faster on environments with zillions of subnets. It reduces parsing time and memory.
Apologies that I wasn’t clear. It does work with the configuration_parser.rb from github current (the one you linked). I replaced the one installed with 1.16 with the current version, restarted foreman-proxy and it parsed the dhcpd.conf file with includes in brackets.