end
end
+ #
+ # make provider config available as 'provider'
+ #
+ def self.provider
+ manager.provider
+ end
+
#
# info about leap command line suite
#
ssh.leap.assert_initialized
end
- ssh.leap.log :syching, "configuration files" do
+ ssh.leap.log :synching, "configuration files" do
sync_hiera_config(ssh)
sync_support_files(ssh)
end
private
def sync_hiera_config(ssh)
- dest_dir = manager.provider.hiera_sync_destination
+ dest_dir = provider.hiera_sync_destination
ssh.leap.rsync_update do |server|
node = manager.node(server.host)
hiera_file = Path.relative_path([:hiera, node.name])
end
def sync_support_files(ssh)
- dest_dir = manager.provider.hiera_sync_destination
+ dest_dir = provider.hiera_sync_destination
ssh.leap.rsync_update do |server|
node = manager.node(server.host)
files_to_sync = node.file_paths.collect {|path| Path.relative_path(path, Path.provider) }
end
execute exec.join('; ')
else
- bail! "No nodes found. This command only works on nodes with ip_address in the network #{manager.provider.vagrant.network}"
+ bail! "No nodes found. This command only works on nodes with ip_address in the network #{provider.vagrant.network}"
end
end
def create_vagrant_file
lines = []
- netmask = IPAddr.new('255.255.255.255').mask(manager.provider.vagrant.network.split('/').last).to_s
+ netmask = IPAddr.new('255.255.255.255').mask(provider.vagrant.network.split('/').last).to_s
lines << %[Vagrant::Config.run do |config|]
manager.each_node do |node|
if node.vagrant?
highest_ip = taken_ips.map{|ip| IPAddr.new(ip)}.max
new_ip = highest_ip.succ
else
- new_ip = IPAddr.new(manager.provider.vagrant.network).succ.succ
+ new_ip = IPAddr.new(provider.vagrant.network).succ.succ
end
return new_ip.to_s
end
end
end
+ def provider
+ manager.provider
+ end
+
def base_path
File.expand_path '../..', __FILE__
end
end
def test_complex_node_search
- domain = manager.provider.domain
+ domain = provider.domain
nodes = manager.nodes['dns.public' => true]
expected = [{"domain_full"=>"ns1.#{domain}"}, {"domain_full"=>"ns2.#{domain}"}, {"domain_full"=>"vpn1.#{domain}"}, {"domain_full"=>"web1.#{domain}"}]
assert_equal expected.size, nodes.size
class ConfigObjectTest < MiniTest::Unit::TestCase
def test_bracket_lookup
- domain = manager.provider.domain
+ domain = provider.domain
vpn1 = manager.nodes['vpn1']
assert_equal "vpn1.#{domain}", vpn1['domain.full']
end