summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2018-02-21 09:51:03 +0000
committerGitHub <noreply@github.com>2018-02-21 09:51:03 +0000
commit5cc94f9f302db4c0d40f61b29636a0bf8a676d0f (patch)
tree83682c68e0e98e7ec35f5814f4f266a8b9c37b2f
parentd118adba4e7e20e76312bc9d0cad88b61af3ad0b (diff)
parent5607aacf82c4fb4da2f1638870e240ef3581be9a (diff)
downloadchef-5cc94f9f302db4c0d40f61b29636a0bf8a676d0f.tar.gz
Merge pull request #6883 from martinisoft/martinisoft/inet_family_support
Add support for network family in ifconfig for Debian platforms
-rw-r--r--lib/chef/provider/ifconfig/debian.rb6
-rw-r--r--lib/chef/resource/ifconfig.rb1
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/chef/provider/ifconfig/debian.rb b/lib/chef/provider/ifconfig/debian.rb
index 369c222b7a..e1e978fdde 100644
--- a/lib/chef/provider/ifconfig/debian.rb
+++ b/lib/chef/provider/ifconfig/debian.rb
@@ -36,11 +36,11 @@ class Chef
<% if new_resource.onboot == "yes" %>auto <%= new_resource.device %><% end %>
<% case new_resource.bootproto
when "dhcp" %>
-iface <%= new_resource.device %> inet dhcp
+iface <%= new_resource.device %> <%= new_resource.family %> dhcp
<% when "bootp" %>
-iface <%= new_resource.device %> inet bootp
+iface <%= new_resource.device %> <%= new_resource.family %> bootp
<% else %>
-iface <%= new_resource.device %> inet static
+iface <%= new_resource.device %> <%= new_resource.family %> static
<% if new_resource.target %>address <%= new_resource.target %><% end %>
<% if new_resource.mask %>netmask <%= new_resource.mask %><% end %>
<% if new_resource.network %>network <%= new_resource.network %><% end %>
diff --git a/lib/chef/resource/ifconfig.rb b/lib/chef/resource/ifconfig.rb
index e9ef47d95b..8c7798566d 100644
--- a/lib/chef/resource/ifconfig.rb
+++ b/lib/chef/resource/ifconfig.rb
@@ -38,6 +38,7 @@ class Chef
property :target, String, name_property: true
property :hwaddr, String
property :mask, String
+ property :family, String, default: "inet"
property :inet_addr, String
property :bcast, String
property :mtu, String