summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaustubh-d <kaustubh@clogeny.com>2013-07-17 23:57:36 -0500
committeradamedx <adamed@opscode.com>2013-07-23 10:36:14 -0700
commit8e64b29447675a271f265d9092a5c1d9d6febd53 (patch)
tree1817a8cf838bc59eb22809318422490981a28927
parent72d6195179f2846220aace216e9b1089e8efc95b (diff)
downloadchef-8e64b29447675a271f265d9092a5c1d9d6febd53.tar.gz
aix ifconfig - handle vips.
-rw-r--r--lib/chef/provider/ifconfig/aix.rb18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/chef/provider/ifconfig/aix.rb b/lib/chef/provider/ifconfig/aix.rb
index fc7da058e1..6d1d82c35c 100644
--- a/lib/chef/provider/ifconfig/aix.rb
+++ b/lib/chef/provider/ifconfig/aix.rb
@@ -73,7 +73,7 @@ class Chef
def add_command
# ifconfig changes are temporary, chdev persist across reboots.
raise Chef::Exceptions::Ifconfig, "interface metric attribute cannot be set for :add action" if @new_resource.metric
- if @current_resource.inet_addr
+ if @current_resource.inet_addr || @new_resource.is_vip
# adding a VIP
command = "chdev -l #{@new_resource.device} -a alias4=#{@new_resource.name}"
command << ",#{@new_resource.mask}" if @new_resource.mask
@@ -86,7 +86,7 @@ class Chef
end
def enable_command
- if @current_resource.inet_addr
+ if @current_resource.inet_addr || @new_resource.is_vip
# add alias
command = "ifconfig #{@new_resource.device} inet #{@new_resource.name}"
command << " netmask #{@new_resource.mask}" if @new_resource.mask
@@ -109,13 +109,17 @@ class Chef
def delete_command
# ifconfig changes are temporary, chdev persist across reboots.
- "chdev -l #{@new_resource.device} -a state=down"
+ if @new_resource.is_vip
+ command = "chdev -l #{@new_resource.device} -a delalias4=#{@new_resource.name}"
+ command << ",#{@new_resource.mask}" if @new_resource.mask
+ else
+ command = "chdev -l #{@new_resource.device} -a state=down"
+ end
+ command
end
- def delete_vip_command
- command = "chdev -l #{@new_resource.device} -a delalias4=#{@new_resource.name}"
- command << ",#{@new_resource.mask}" if @new_resource.mask
- command
+ def loopback_device
+ "lo0"
end
def hex_to_dec_netmask(netmask)