lib/bolt_spec/run.rb in bolt-2.19.0 vs lib/bolt_spec/run.rb in bolt-2.20.0
- old
+ new
@@ -78,10 +78,26 @@
end
result = result.to_a
Bolt::Util.walk_keys(result, &:to_s)
end
+ def download_file(source, dest, targets, options: {}, config: nil, inventory: nil)
+ if config.nil? && defined?(bolt_config)
+ config = bolt_config
+ end
+
+ if inventory.nil? && defined?(bolt_inventory)
+ inventory = bolt_inventory
+ end
+
+ result = BoltRunner.with_runner(config, inventory) do |runner|
+ runner.download_file(source, dest, targets, options)
+ end
+ result = result.to_a
+ Bolt::Util.walk_keys(result, &:to_s)
+ end
+
def upload_file(source, dest, targets, options: {}, config: nil, inventory: nil)
if config.nil? && defined?(bolt_config)
config = bolt_config
end
@@ -190,9 +206,15 @@
def run_script(script, targets, arguments, options = {})
executor = Bolt::Executor.new(config.concurrency, @analytics)
targets = inventory.get_targets(targets)
executor.run_script(targets, script, arguments, options)
+ end
+
+ def download_file(source, dest, targets, options = {})
+ executor = Bolt::Executor.new(config.concurrency, @analytics)
+ targets = inventory.get_targets(targets)
+ executor.download_file(targets, source, dest, options)
end
def upload_file(source, dest, targets, options = {})
executor = Bolt::Executor.new(config.concurrency, @analytics)
targets = inventory.get_targets(targets)