Clean up for network::interface definition.
This commit is contained in:
parent
3975b50621
commit
2592ca9fad
2 changed files with 6 additions and 8 deletions
|
@ -31,7 +31,7 @@ class network::helper::restart {
|
|||
# Network device name.
|
||||
# $ipaddr:
|
||||
# IP address for interface. Use dhcp for DHCP configuration and none
|
||||
# if interface just needs to be brought up.
|
||||
# if interface just needs to be brought up. Defaults to none.
|
||||
# $netmask:
|
||||
# Netmask for interface. Required only when $ipaddr is used.
|
||||
# $options:
|
||||
|
@ -64,10 +64,7 @@ define network::interface($options = [], $ipaddr = "none", $netmask = "none") {
|
|||
openbsd: {
|
||||
file { "/etc/hostname.${name}":
|
||||
ensure => present,
|
||||
content => $proto ? {
|
||||
none => "up\n",
|
||||
default => template("network/hostname.if.erb"),
|
||||
},
|
||||
content => template("network/hostname.if.erb"),
|
||||
mode => 0600,
|
||||
owner => root,
|
||||
group => wheel,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<% if proto == 'dhcp' -%>
|
||||
dhcp NONE NONE NONE<% options.each do |val| -%> <%= val -%><% end -%>
|
||||
dhcp NONE NONE NONE<% options.each do |val| %> <%= val %><% end %>
|
||||
<% elsif proto == 'none' -%>
|
||||
up
|
||||
<% else -%>
|
||||
inet <%= ipaddr -%> <%= netmask -%> NONE<% options.each do |val| -%> <%= val -%><% end -%>
|
||||
inet <%= ipaddr %> <%= netmask %> NONE<% options.each do |val| %> <%= val %><% end %>
|
||||
<% end -%>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue