From eac3056c237d523f4786593922fe8f88eb65dff7 Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 29 Mar 2016 13:27:01 -0700 Subject: testing: adds mx delivery tests --- lib/leap_cli/macros/hosts.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib') diff --git a/lib/leap_cli/macros/hosts.rb b/lib/leap_cli/macros/hosts.rb index 8281329f..541bbc13 100644 --- a/lib/leap_cli/macros/hosts.rb +++ b/lib/leap_cli/macros/hosts.rb @@ -3,6 +3,24 @@ module LeapCli module Macro + ## + ## IPs + ## + + # + # returns a simple array of all the IPs for the specified node list + # + def host_ips(node_list) + if self.vagrant? + node_list = node_list['environment' => 'local'] + else + node_list = node_list['environment' => '!local'] + end + node_list.map {|name, n| + [n.ip_address, (global.facts[name]||{})['ec2_public_ipv4']] + }.flatten.compact.uniq + end + ## ## HOSTS ## @@ -48,6 +66,10 @@ module LeapCli 'domain_full' => node.domain.full, 'port' => node.ssh.port } + if node.dns['aliases'] && node.dns['aliases'].any? + # include aliases, but without domain.full + hosts[node.name]['aliases'] = node.dns['aliases'] - [node.domain.full] + end node_location = node['location'] ? node['location']['name'] : nil if my_location == node_location if facts = @node.manager.facts[node.name] -- cgit v1.2.3