Skip to content
New issue

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

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

Already on GitHub? # to your account

add parameters option for hosts #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions manifests/host.pp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# == Define: dhcp::host
#
# @param [Hash] parameters set different parameters like e.g. filename for the host
Copy link
Member

Choose a reason for hiding this comment

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

The type is redundant and will be read from the parameter

Suggested change
# @param [Hash] parameters set different parameters like e.g. filename for the host
# @param parameters set different parameters like e.g. filename for the host

define dhcp::host (
Optional[Stdlib::IP::Address] $ip = undef,
Dhcp::Mac $mac,
String $ddns_hostname = $name,
Hash $options = {},
Hash $parameters = {},
String $comment = '',
Boolean $ignored = false,
Optional[Integer] $default_lease_time = undef,
Expand Down
3 changes: 3 additions & 0 deletions templates/dhcpd.host.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ host <%= @host %> {
option <%= option %> <%= @options[option] %>;
<% end -%>
<% end -%>
<% @parameters.keys.sort.each do |param| -%>
<%= param %> <%= @parameters[param] %>;
Comment on lines +24 to +25
Copy link
Member

Choose a reason for hiding this comment

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

Untested, but I think this also works:

Suggested change
<% @parameters.keys.sort.each do |param| -%>
<%= param %> <%= @parameters[param] %>;
<% @parameters.sort.each do |param, value| -%>
<%= param %> <%= value %>;

<% end -%>
<% if not @on_commit.empty? -%>
on commit {
<% @on_commit.each do |statement| -%>
Expand Down