Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow host declaration without IP. #210

Merged
merged 1 commit into from
Mar 16, 2019
Merged

Allow host declaration without IP. #210

merged 1 commit into from
Mar 16, 2019

Conversation

mergwyn
Copy link
Contributor

@mergwyn mergwyn commented Jan 3, 2019

Pull Request (PR) description

I often use dhcp to allocate hostnames or to distribute other options (eg routers) where I don't care about the IP address. I tried similar code to the above, but (using hiera) I received a message when I did not include an IP address:

Evaluation Error: Error while evaluating a Resource Statement, Dhcp::Host[LGwebOSTV]: expects a value for parameter 'ip' (file: /etc/puppetlabs/code/environments/production/modules/dhcp/manifests/init.pp, line: 289)

I have worked around this by setting the IP address to 0.0.0.0 and then ignoring it in the template but this seems like a kludge!

This Pull Request (PR) fixes the following issues

Fixes #106

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be better not to abuse some IP but rather make the value optional. This means changing the type to Optional[Stdlib::Compat::Ip_address] $ip = undef and changing the template as well.

@mergwyn
Copy link
Contributor Author

mergwyn commented Jan 4, 2019

Thanks for the advice. Would you also like me to squash the commits?

@bastelfreak
Copy link
Member

@mergwyn can you please rebase and squash afterwards?

@bastelfreak bastelfreak added the enhancement New feature or request label Mar 9, 2019
@mergwyn
Copy link
Contributor Author

mergwyn commented Mar 15, 2019

rebase and squash completed - please let me know if you need anything else.

manifests/host.pp Outdated Show resolved Hide resolved
@bastelfreak bastelfreak added the needs-work not ready to merge just yet label Mar 16, 2019
@bastelfreak bastelfreak removed needs-rebase needs-work not ready to merge just yet labels Mar 16, 2019
@bastelfreak bastelfreak merged commit bbe0c82 into voxpupuli:master Mar 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Insert possibility to enable host declaration without IP.
4 participants