diff options
author | Xabier de Zuazo <xabier@zuazo.org> | 2013-02-08 12:52:29 +0100 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2013-06-19 14:09:21 -0700 |
commit | 16aaa0f8a353f3b429c9e908dd3b0bf5de11bc1b (patch) | |
tree | e40f3b37b3ba5b56e473595f911cc8f2ed17e4f4 /lib/chef/provider/ifconfig.rb | |
parent | 71fbdcfda3926455c231b6a027471a5d4767c56c (diff) | |
download | chef-16aaa0f8a353f3b429c9e908dd3b0bf5de11bc1b.tar.gz |
[CHEF-3029] Redhat ifconfig provider detached
Diffstat (limited to 'lib/chef/provider/ifconfig.rb')
-rw-r--r-- | lib/chef/provider/ifconfig.rb | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/lib/chef/provider/ifconfig.rb b/lib/chef/provider/ifconfig.rb index 86680b2229..5616ba77e7 100644 --- a/lib/chef/provider/ifconfig.rb +++ b/lib/chef/provider/ifconfig.rb @@ -164,49 +164,9 @@ class Chef end def generate_config - b = binding - case node[:platform] - when "centos","redhat","fedora" - content = %{ -<% if @new_resource.device %>DEVICE=<%= @new_resource.device %><% end %> -<% if @new_resource.onboot %>ONBOOT=<%= @new_resource.onboot %><% end %> -<% if @new_resource.bootproto %>BOOTPROTO=<%= @new_resource.bootproto %><% end %> -<% if @new_resource.target %>IPADDR=<%= @new_resource.target %><% end %> -<% if @new_resource.mask %>NETMASK=<%= @new_resource.mask %><% end %> -<% if @new_resource.network %>NETWORK=<%= @new_resource.network %><% end %> -<% if @new_resource.bcast %>BROADCAST=<%= @new_resource.bcast %><% end %> -<% if @new_resource.onparent %>ONPARENT=<%= @new_resource.onparent %><% end %> - } - template = ::ERB.new(content) - network_file_name = "/etc/sysconfig/network-scripts/ifcfg-#{@new_resource.device}" - converge_by ("generate configuration file : #{network_file_name}") do - network_file = ::File.new(network_file_name, "w") - network_file.puts(template.result(b)) - network_file.close - end - Chef::Log.info("#{@new_resource} created configuration file") - when "debian","ubuntu" - # template - when "slackware" - # template - end end def delete_config - require 'fileutils' - case node[:platform] - when "centos","redhat","fedora" - ifcfg_file = "/etc/sysconfig/network-scripts/ifcfg-#{@new_resource.device}" - if ::File.exist?(ifcfg_file) - converge_by ("delete the #{ifcfg_file}") do - FileUtils.rm_f(ifcfg_file, :verbose => false) - end - end - when "debian","ubuntu" - # delete configs - when "slackware" - # delete configs - end end end |