Bug #9302
closedOmitting "optional" options in the provisioning wizard results in a syntactically invalid dhcpd.conf
Description
In Foreman's wizard for setting up provisioning, on page 2, "Network config" there are several fields labeled "optional" -- dhcp address ranges, gateway and primary dns. I've not tried omitting the primary dns, but omitting any of the other fields results in a syntactically invalid dhcpd.conf. For example, if you omit the address range fields, dhcpd.conf ends up containing:
range ;
There are two fairly obvious problems here:
1) The wizard is incorrect, these values are clearly mandatory.
2) The cli tool is not checking its arguments carefully either -- the generated command should complain if it's missing an option that will be required to complete successfully.
Updated by Ian Denhardt over 9 years ago
When omitting everything "optional" but the primary dns dhcpd fails to start with the following in the output of journalctl -xe (CentOS 7 host):
Feb 10 06:05:54 foreman dhcpd[31782]: Internet Systems Consortium DHCP Server 4.2.5 Feb 10 06:05:54 foreman dhcpd[31782]: Copyright 2004-2013 Internet Systems Consortium. Feb 10 06:05:54 foreman dhcpd[31782]: All rights reserved. Feb 10 06:05:54 foreman dhcpd[31782]: For info, please visit https://www.isc.org/software/dhcp/ Feb 10 06:05:54 foreman dhcpd[31782]: /etc/dhcp/dhcpd.conf line 33: expecting numeric value. Feb 10 06:05:54 foreman dhcpd[31782]: range ; Feb 10 06:05:54 foreman dhcpd[31782]: ^ Feb 10 06:05:54 foreman dhcpd[31782]: /etc/dhcp/dhcpd.conf line 38: semicolon expected. Feb 10 06:05:54 foreman dhcpd[31782]: } Feb 10 06:05:54 foreman dhcpd[31782]: ^ Feb 10 06:05:54 foreman dhcpd[31782]: /etc/dhcp/dhcpd.conf line 38: unexpected end of file Feb 10 06:05:54 foreman dhcpd[31782]: Feb 10 06:05:54 foreman dhcpd[31782]: ^ Feb 10 06:05:54 foreman dhcpd[31782]: /etc/dhcp/dhcpd.conf line 38: unexpected end of file Feb 10 06:05:54 foreman dhcpd[31782]: Feb 10 06:05:54 foreman dhcpd[31782]: ^ Feb 10 06:05:54 foreman dhcpd[31782]: Configuration file errors encountered -- exiting Feb 10 06:05:54 foreman dhcpd[31782]: Feb 10 06:05:54 foreman dhcpd[31782]: This version of ISC DHCP is based on the release available Feb 10 06:05:54 foreman dhcpd[31782]: on ftp.isc.org. Features have been added and other changes Feb 10 06:05:54 foreman dhcpd[31782]: have been made to the base software release in order to make Feb 10 06:05:54 foreman dhcpd[31782]: it work better with this distribution. Feb 10 06:05:54 foreman dhcpd[31782]: Feb 10 06:05:54 foreman dhcpd[31782]: Please report for this software via the CentOS Bugs Database: Feb 10 06:05:54 foreman dhcpd[31782]: http://bugs.centos.org/ Feb 10 06:05:54 foreman dhcpd[31782]: Feb 10 06:05:54 foreman dhcpd[31782]: exiting. Feb 10 06:05:54 foreman systemd[1]: dhcpd.service: main process exited, code=exited, status=1/FAILURE Feb 10 06:05:54 foreman systemd[1]: Failed to start DHCPv4 Server Daemon. -- Subject: Unit dhcpd.service has failed
Updated by Dominic Cleal over 9 years ago
- Project changed from Foreman to Installer
- Status changed from New to Resolved
I think this has been fixed by the following commit:
https://github.com/theforeman/puppet-dhcp/commit/b1503c75f6da77ed76cc96007b7c48bde76a2992
This will be available in Foreman 1.8.