diff --git a/CHANGELOG.md b/CHANGELOG.md index e999639..a454587 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ rightscale_tag Cookbook CHANGELOG This file is used to list changes made in each version of the rightscale_tag cookbook. +v1.0.6 +------ + +- Remove workaround logic to handle cloudstack behaviour with IP addresses. + v1.0.5 ------ diff --git a/metadata.rb b/metadata.rb index 0d81905..a7fe298 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ license 'Apache 2.0' description 'Provides LWRPs and helper methods for building 3-tier applications using machine tags in RightScale' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '1.0.5' +version '1.0.6' depends 'machine_tag', '~> 1.0.3' depends 'marker', '~> 1.0.0' diff --git a/recipes/default.rb b/recipes/default.rb index ab537f7..3544f5a 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -28,25 +28,15 @@ end if node['cloud'] - # For cloudstack, ignore 'cloud/public_ips' and determine if - # 'cloud/private_ips' are private or public IPs and set tags accordingly. - if node['cloud']['provider'] == 'cloudstack' - if node['cloud']['private_ips'] - private_ips, public_ips = node['cloud']['private_ips'].reject { |ip| ip.nil? || ip.empty? }.partition { |ip| IPAddress(ip).private? } - public_ips.each_with_index { |public_ip, index| machine_tag "server:public_ip_#{index}=#{public_ip}" } - private_ips.each_with_index { |private_ip, index| machine_tag "server:private_ip_#{index}=#{private_ip}" } - end - else - if node['cloud']['public_ips'] - node['cloud']['public_ips'].reject { |ip| ip.nil? || ip.empty? || IPAddress(ip).private? }.each_with_index do |public_ip, index| - machine_tag "server:public_ip_#{index}=#{public_ip}" - end + if node['cloud']['public_ips'] + node['cloud']['public_ips'].reject { |ip| ip.nil? || ip.empty? || IPAddress(ip).private? }.each_with_index do |public_ip, index| + machine_tag "server:public_ip_#{index}=#{public_ip}" end + end - if node['cloud']['private_ips'] - node['cloud']['private_ips'].reject { |ip| ip.nil? || ip.empty? || !IPAddress(ip).private? }.each_with_index do |private_ip, index| - machine_tag "server:private_ip_#{index}=#{private_ip}" - end + if node['cloud']['private_ips'] + node['cloud']['private_ips'].reject { |ip| ip.nil? || ip.empty? || !IPAddress(ip).private? }.each_with_index do |private_ip, index| + machine_tag "server:private_ip_#{index}=#{private_ip}" end end end