summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/provider/ifconfig/debian.rb1
-rw-r--r--lib/chef/provider/ifconfig/redhat.rb1
-rw-r--r--lib/chef/resource/ifconfig.rb8
3 files changed, 8 insertions, 2 deletions
diff --git a/lib/chef/provider/ifconfig/debian.rb b/lib/chef/provider/ifconfig/debian.rb
index aee3ca02dc..e610bab5df 100644
--- a/lib/chef/provider/ifconfig/debian.rb
+++ b/lib/chef/provider/ifconfig/debian.rb
@@ -48,6 +48,7 @@ iface <%= new_resource.device %> <%= new_resource.family %> static
<% if new_resource.metric %>metric <%= new_resource.metric %><% end %>
<% if new_resource.hwaddr %>hwaddress <%= new_resource.hwaddr %><% end %>
<% if new_resource.mtu %>mtu <%= new_resource.mtu %><% end %>
+ <% if new_resource.gateway %>gateway <%= new_resource.gateway %><% end %>
<% end %>
<% end %>
}
diff --git a/lib/chef/provider/ifconfig/redhat.rb b/lib/chef/provider/ifconfig/redhat.rb
index 24cea17b1a..70d78bcfe9 100644
--- a/lib/chef/provider/ifconfig/redhat.rb
+++ b/lib/chef/provider/ifconfig/redhat.rb
@@ -43,6 +43,7 @@ class Chef
<% if new_resource.master %>MASTER=<%= new_resource.master %><% end %>
<% if new_resource.slave %>SLAVE=<%= new_resource.slave %><% end %>
<% if new_resource.vlan %>VLAN=<%= new_resource.vlan %><% end %>
+<% if new_resource.gateway %>GATEWAY=<%= new_resource.gateway %><% end %>
}
@config_path = "/etc/sysconfig/network-scripts/ifcfg-#{new_resource.device}"
end
diff --git a/lib/chef/resource/ifconfig.rb b/lib/chef/resource/ifconfig.rb
index 2ea0381991..e2a35e6d43 100644
--- a/lib/chef/resource/ifconfig.rb
+++ b/lib/chef/resource/ifconfig.rb
@@ -45,8 +45,8 @@ class Chef
property :mask, String,
description: "The decimal representation of the network mask. For example: 255.255.255.0."
- property :family, String,
- default: "inet", introduced: "14.0",
+ property :family, String, default: "inet",
+ introduced: "14.0",
description: "Networking family option for Debian-based systems. For example: inet or inet6."
property :inet_addr, String,
@@ -96,6 +96,10 @@ class Chef
property :vlan, String,
introduced: "14.4",
description: "The VLAN to assign the interface to."
+
+ property :gateway, String,
+ introduced: "14.4",
+ description: "The gateway to use for the interface."
end
end
end