Skip to content

Commit 3897ec3

Browse files
bastelfreakekohl
andcommitted
Add support to rsync fixtures into SUTs
Co-authored-by: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
1 parent fc0677d commit 3897ec3

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

lib/beaker_puppet_helpers/module_utils.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,24 @@ def install_local_module_on(hosts, source = '.')
5656
File.unlink(source_path) if source_path
5757
end
5858
end
59+
60+
# Copies all local dependencies into a SUT via rsync+ssh
61+
#
62+
# install_local_module_on creates an archive, scps it and then unpack it.
63+
# That takes up a lot of time when you've many modules. rsync+ssh is a faster alternative,
64+
# but it requires rsync in the SUT and on the Host.
65+
# Use the spec_prep rake task to deploy the dependencies locally.
66+
#
67+
# @param [Beaker::Host, Array<Beaker::Host>, String, Symbol] hosts
68+
# One or more hosts to act upon, or a role (String or Symbol) that
69+
# identifies one or more hosts.
70+
# @param [String] source
71+
# The directory where the modules sit
72+
# @param [String] destination
73+
# The directory where the modules will be placed
74+
def install_puppet_modules_via_rsync(hosts, source = 'spec/fixtures/modules/', destination = '/etc/puppetlabs/code/environments/production/modules')
75+
real_source = File.realpath(source)
76+
rsync_to(hosts, real_source, destination)
77+
end
5978
end
6079
end

0 commit comments

Comments
 (0)