diff options
author | Tom Doherty <tom.doherty@fixnetix.com> | 2017-09-07 21:22:54 +0100 |
---|---|---|
committer | Tom Doherty <tom.doherty@fixnetix.com> | 2017-09-07 21:22:54 +0100 |
commit | 37829e9f1f12f8cf0aa5a6ec09bd0053c2057846 (patch) | |
tree | 4e1e3bf11ed763720819fb7d5837db7ded0fb1fd /lib/chef | |
parent | 32c323bea2030096a0a9d04102751842d9c7d001 (diff) | |
download | chef-37829e9f1f12f8cf0aa5a6ec09bd0053c2057846.tar.gz |
Add options for bonding NICs on RHEL/Centos
Signed-off-by: Tom Doherty <tom.doherty@fixnetix.com>
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/provider/ifconfig/redhat.rb | 3 | ||||
-rw-r--r-- | lib/chef/resource/ifconfig.rb | 27 |
2 files changed, 30 insertions, 0 deletions
diff --git a/lib/chef/provider/ifconfig/redhat.rb b/lib/chef/provider/ifconfig/redhat.rb index cce7e9dc3b..1f4f6d972a 100644 --- a/lib/chef/provider/ifconfig/redhat.rb +++ b/lib/chef/provider/ifconfig/redhat.rb @@ -39,6 +39,9 @@ class Chef <% if new_resource.metric %>METRIC=<%= new_resource.metric %><% end %> <% if new_resource.mtu %>MTU=<%= new_resource.mtu %><% end %> <% if new_resource.ethtool_opts %>ETHTOOL_OPTS=<%= new_resource.ethtool_opts %><% end %> +<% if new_resource.bonding_opts %>BONDING_OPTS=<%= new_resource.bonding_opts %><% end %> +<% if new_resource.master %>MASTER=<%= new_resource.master %><% end %> +<% if new_resource.slave %>SLAVE=<%= new_resource.slave %><% 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 a8317f8c57..3673311348 100644 --- a/lib/chef/resource/ifconfig.rb +++ b/lib/chef/resource/ifconfig.rb @@ -45,6 +45,9 @@ class Chef @bootproto = nil @onparent = nil @ethtool_opts = nil + @bonding_opts = nil + @master = nil + @slave = nil end def target(arg = nil) @@ -150,6 +153,30 @@ class Chef :kind_of => String ) end + + def bonding_opts(arg = nil) + set_or_return( + :bonding_opts, + arg, + :kind_of => String + ) + end + + def master(arg = nil) + set_or_return( + :master, + arg, + :kind_of => String + ) + end + + def slave(arg = nil) + set_or_return( + :slave, + arg, + :kind_of => String + ) + end end end |