add ipsort function for RHOS deployment order
This commit is contained in:
parent
51f529c1bb
commit
03ecafb819
@ -0,0 +1,13 @@
|
||||
module Puppet::Parser::Functions
|
||||
newfunction(:ipsort, :type => :rvalue , :doc => <<-EOS
|
||||
Returns list sorted of sorted IP addresses.
|
||||
EOS
|
||||
) do |args|
|
||||
require 'rubygems'
|
||||
require 'ipaddr'
|
||||
ips = args[0]
|
||||
sorted_ips = ips.sort { |a,b| IPAddr.new( a ) <=> IPAddr.new( b ) }
|
||||
sorted_ips
|
||||
end
|
||||
end
|
||||
|
@ -119,7 +119,7 @@ class osnailyfacter::cluster_ha {
|
||||
$controller_public_addresses = nodes_to_hash($controllers,'name','public_address')
|
||||
$controller_storage_addresses = nodes_to_hash($controllers,'name','storage_address')
|
||||
$controller_hostnames = keys($controller_internal_addresses)
|
||||
$controller_nodes = sort(values($controller_internal_addresses))
|
||||
$controller_nodes = ipsort(values($controller_internal_addresses))
|
||||
$controller_node_public = $::fuel_settings['public_vip']
|
||||
$controller_node_address = $::fuel_settings['management_vip']
|
||||
$mountpoints = filter_hash($mp_hash,'point')
|
||||
|
Loading…
Reference in New Issue
Block a user