Method: Beaker::DSL::InstallUtils#copy_module_to
- Defined in:
- lib/beaker/dsl/install_utils.rb
#copy_module_to(one_or_more_hosts, opts = {}) ⇒ Object Also known as: copy_root_module_to
Install local module for acceptance testing should be used as a presuite to ensure local module is copied to the hosts you want, particularly masters
1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 |
# File 'lib/beaker/dsl/install_utils.rb', line 1422 def copy_module_to(one_or_more_hosts, opts = {}) block_on one_or_more_hosts do |host| opts = {:source => './', :target_module_path => host['distmoduledir'], :ignore_list => PUPPET_MODULE_INSTALL_IGNORE}.merge(opts) ignore_list = build_ignore_list(opts) target_module_dir = on( host, "echo #{opts[:target_module_path]}" ).stdout.chomp source_path = File.( opts[:source] ) source_dir = File.dirname(source_path) source_name = File.basename(source_path) if opts.has_key?(:module_name) module_name = opts[:module_name] else _, module_name = parse_for_modulename( source_path ) end opts[:protocol] ||= 'scp' case opts[:protocol] when 'scp' #move to the host scp_to host, source_path, target_module_dir, {:ignore => ignore_list} #rename to the selected module name, if not correct cur_path = File.join(target_module_dir, source_name) new_path = File.join(target_module_dir, module_name) if cur_path != new_path # NOTE: this will need to be updated to handle powershell only windows SUTs on host, "mv #{cur_path} #{new_path}" end when 'rsync' rsync_to host, source, File.join(target_module_dir, module_name), {:ignore => ignore_list} else logger.debug "Unsupported transfer protocol, returning nil" nil end end end |