beaker 2.15.1 → 2.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/HISTORY.md +238 -2
- data/acceptance/tests/hypervisor/communication.rb +7 -0
- data/lib/beaker/answers/version30.rb +51 -46
- data/lib/beaker/dsl/install_utils/foss_utils.rb +146 -66
- data/lib/beaker/dsl/install_utils/pe_utils.rb +8 -4
- data/lib/beaker/host.rb +18 -12
- data/lib/beaker/host/pswindows/exec.rb +16 -0
- data/lib/beaker/host/unix/exec.rb +16 -0
- data/lib/beaker/host/unix/pkg.rb +2 -0
- data/lib/beaker/host/windows/exec.rb +17 -0
- data/lib/beaker/host_prebuilt_steps.rb +1 -1
- data/lib/beaker/hypervisor/aws_sdk.rb +78 -4
- data/lib/beaker/junit.xsl +27 -1
- data/lib/beaker/options/command_line_parser.rb +6 -0
- data/lib/beaker/options/presets.rb +5 -0
- data/lib/beaker/platform.rb +6 -1
- data/lib/beaker/test_suite.rb +35 -3
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/answers_spec.rb +42 -5
- data/spec/beaker/dsl/install_utils/foss_utils_spec.rb +1 -1
- data/spec/beaker/dsl/install_utils/pe_utils_spec.rb +4 -2
- data/spec/beaker/host_spec.rb +23 -0
- data/spec/beaker/hypervisor/aws_sdk_spec.rb +35 -3
- data/spec/beaker/options/command_line_parser_spec.rb +2 -2
- data/spec/beaker/test_suite_spec.rb +37 -0
- metadata +3 -2
@@ -208,8 +208,9 @@ module Beaker
|
|
208
208
|
# or a role (String or Symbol) that identifies one or more hosts.
|
209
209
|
# @param [Hash{Symbol=>String}] opts
|
210
210
|
# @option opts [String] :version Version of puppet to download
|
211
|
+
# @option opts [String] :puppet_agent_version Version of puppet agent to download
|
211
212
|
# @option opts [String] :mac_download_url Url to download msi pattern of %url%/puppet-%version%.msi
|
212
|
-
# @option opts [String] :win_download_url Url to download dmg
|
213
|
+
# @option opts [String] :win_download_url Url to download dmg pattern of %url%/(puppet|hiera|facter)-%version%.msi
|
213
214
|
#
|
214
215
|
# @return nil
|
215
216
|
# @raise [StandardError] When encountering an unsupported platform by default, or if gem cannot be found when default_action => 'gem_install'
|
@@ -219,7 +220,8 @@ module Beaker
|
|
219
220
|
|
220
221
|
# If version isn't specified assume the latest in the 3.x series
|
221
222
|
if opts[:version] and not version_is_less(opts[:version], '4.0.0')
|
222
|
-
|
223
|
+
# backwards compatability
|
224
|
+
opts[:puppet_agent_version] ||= opts[:version]
|
223
225
|
install_puppet_agent_on(hosts, opts)
|
224
226
|
|
225
227
|
else
|
@@ -260,8 +262,8 @@ module Beaker
|
|
260
262
|
#Install Puppet Agent based on specified hosts using provided options
|
261
263
|
# @example will install puppet-agent 1.1.0 from native puppetlabs provided packages wherever possible and will fail over to gem installing latest puppet
|
262
264
|
# install_puppet_agent_on(hosts, {
|
263
|
-
# :
|
264
|
-
# :default_action
|
265
|
+
# :puppet_agent_version => '1.1.0',
|
266
|
+
# :default_action => 'gem_install',
|
265
267
|
# })
|
266
268
|
#
|
267
269
|
#
|
@@ -275,10 +277,10 @@ module Beaker
|
|
275
277
|
# @param [Host, Array<Host>, String, Symbol] hosts One or more hosts to act upon,
|
276
278
|
# or a role (String or Symbol) that identifies one or more hosts.
|
277
279
|
# @param [Hash{Symbol=>String}] opts
|
278
|
-
# @option opts [String] :
|
280
|
+
# @option opts [String] :puppet_agent_version Version of puppet to download
|
279
281
|
# @option opts [String] :puppet_gem_version Version of puppet to install via gem if no puppet-agent package is available
|
280
282
|
# @option opts [String] :mac_download_url Url to download msi pattern of %url%/puppet-agent-%version%.msi
|
281
|
-
# @option opts [String] :win_download_url Url to download dmg
|
283
|
+
# @option opts [String] :win_download_url Url to download dmg pattern of %url%/puppet-agent-%version%.msi
|
282
284
|
# @option opts [String] :puppet_collection Defaults to 'pc1'
|
283
285
|
#
|
284
286
|
# @return nil
|
@@ -287,6 +289,10 @@ module Beaker
|
|
287
289
|
def install_puppet_agent_on(hosts, opts)
|
288
290
|
opts = FOSS_DEFAULT_DOWNLOAD_URLS.merge(opts)
|
289
291
|
opts[:puppet_collection] ||= 'pc1' #hi! i'm case sensitive! be careful!
|
292
|
+
opts[:puppet_agent_version] ||= opts[:version] #backwards compatability with old parameter name
|
293
|
+
if not opts[:puppet_agent_version]
|
294
|
+
raise "must provide :puppet_agent_version (puppet-agent version) for install_puppet_agent_on"
|
295
|
+
end
|
290
296
|
|
291
297
|
block_on hosts do |host|
|
292
298
|
host[:type] = 'aio' #we are installing agent, so we want aio type
|
@@ -296,15 +302,15 @@ module Beaker
|
|
296
302
|
logger.warn("install_puppet_agent_on for pe-only platform #{host['platform']} - use install_puppet_agent_pe_promoted_repo_on")
|
297
303
|
when /el-|fedora/
|
298
304
|
install_puppetlabs_release_repo(host, opts[:puppet_collection])
|
299
|
-
if opts[:
|
300
|
-
host.install_package("puppet-agent-#{opts[:
|
305
|
+
if opts[:puppet_agent_version]
|
306
|
+
host.install_package("puppet-agent-#{opts[:puppet_agent_version]}")
|
301
307
|
else
|
302
308
|
host.install_package('puppet-agent')
|
303
309
|
end
|
304
310
|
when /debian|ubuntu|cumulus/
|
305
311
|
install_puppetlabs_release_repo(host, opts[:puppet_collection])
|
306
|
-
if opts[:
|
307
|
-
host.install_package("puppet-agent=#{opts[:
|
312
|
+
if opts[:puppet_agent_version]
|
313
|
+
host.install_package("puppet-agent=#{opts[:puppet_agent_version]}-1#{host['platform'].codename}")
|
308
314
|
else
|
309
315
|
host.install_package('puppet-agent')
|
310
316
|
end
|
@@ -522,7 +528,7 @@ module Beaker
|
|
522
528
|
# @param [Host, Array<Host>, String, Symbol] hosts One or more hosts to act upon,
|
523
529
|
# or a role (String or Symbol) that identifies one or more hosts.
|
524
530
|
# @param [Hash{Symbol=>String}] opts An options hash
|
525
|
-
# @option opts [String] :
|
531
|
+
# @option opts [String] :puppet_agent_version The version of Puppet Agent to install
|
526
532
|
# @option opts [String] :win_download_url The url to download puppet from
|
527
533
|
#
|
528
534
|
# @note on windows, the +:ruby_arch+ host parameter can determine in addition
|
@@ -530,13 +536,14 @@ module Beaker
|
|
530
536
|
def install_puppet_agent_from_msi_on(hosts, opts)
|
531
537
|
block_on hosts do |host|
|
532
538
|
|
539
|
+
host[:type] = 'aio' #we are installing agent, so we want aio type
|
533
540
|
is_config_32 = true == (host['ruby_arch'] == 'x86') || host['install_32'] || opts['install_32']
|
534
541
|
should_install_64bit = host.is_x86_64? && !is_config_32
|
535
542
|
arch = should_install_64bit ? 'x64' : 'x86'
|
536
543
|
|
537
544
|
# If we don't specify a version install the latest MSI for puppet-agent
|
538
|
-
if opts[:
|
539
|
-
host['dist'] = "puppet-agent-#{opts[:
|
545
|
+
if opts[:puppet_agent_version]
|
546
|
+
host['dist'] = "puppet-agent-#{opts[:puppet_agent_version]}-#{arch}"
|
540
547
|
else
|
541
548
|
host['dist'] = "puppet-agent-#{arch}-latest"
|
542
549
|
end
|
@@ -585,6 +592,7 @@ module Beaker
|
|
585
592
|
# or a role (String or Symbol) that identifies one or more hosts.
|
586
593
|
# @param [Hash{Symbol=>String}] opts An options hash
|
587
594
|
# @option opts [String] :version The version of Puppet to install
|
595
|
+
# @option opts [String] :puppet_version The version of puppet-agent to install
|
588
596
|
# @option opts [String] :facter_version The version of Facter to install
|
589
597
|
# @option opts [String] :hiera_version The version of Hiera to install
|
590
598
|
# @option opts [String] :mac_download_url Url to download msi pattern of %url%/puppet-%version%.msi
|
@@ -593,14 +601,14 @@ module Beaker
|
|
593
601
|
# @api private
|
594
602
|
def install_puppet_from_dmg_on( hosts, opts )
|
595
603
|
block_on hosts do |host|
|
596
|
-
if
|
604
|
+
# install puppet-agent if puppet version > 4.0 OR not puppet version is provided
|
605
|
+
if (opts[:version] && !version_is_less(opts[:version], '4.0.0')) || !opts[:version]
|
597
606
|
if opts[:puppet_agent_version].nil?
|
598
607
|
raise "You must specify the version of puppet-agent you " +
|
599
608
|
"want to install if you want to install Puppet 4.0 " +
|
600
609
|
"or greater on OSX"
|
601
610
|
end
|
602
611
|
|
603
|
-
opts[:version] = opts[:puppet_agent_version]
|
604
612
|
install_puppet_agent_from_dmg_on(host, opts)
|
605
613
|
|
606
614
|
else
|
@@ -626,22 +634,36 @@ module Beaker
|
|
626
634
|
end
|
627
635
|
alias_method :install_puppet_from_dmg, :install_puppet_from_dmg_on
|
628
636
|
|
629
|
-
# Installs
|
637
|
+
# Installs puppet-agent and dependencies from dmg on provided host(s).
|
630
638
|
#
|
631
639
|
# @param [Host, Array<Host>, String, Symbol] hosts One or more hosts to act upon,
|
632
640
|
# or a role (String or Symbol) that identifies one or more hosts.
|
633
641
|
# @param [Hash{Symbol=>String}] opts An options hash
|
634
|
-
# @option opts [String] :
|
635
|
-
# @option opts [String] :mac_download_url Url to download msi pattern of %url%/puppet-%version%.
|
642
|
+
# @option opts [String] :puppet_agent_version The version of Puppet Agent to install, defaults to latest
|
643
|
+
# @option opts [String] :mac_download_url Url to download msi pattern of %url%/puppet-%version%.dmg
|
644
|
+
# @option opts [String] :puppet_collection Defaults to 'PC1'
|
636
645
|
#
|
637
646
|
# @return nil
|
638
647
|
# @api private
|
639
648
|
def install_puppet_agent_from_dmg_on(hosts, opts)
|
649
|
+
opts[:puppet_collection] ||= 'PC1'
|
650
|
+
opts[:puppet_collection] = opts[:puppet_collection].upcase #needs to be upcase, more lovely consistency
|
640
651
|
block_on hosts do |host|
|
641
|
-
version = opts[:version] || 'latest'
|
642
|
-
on host, "curl -O #{opts[:mac_download_url]}/puppet-agent-#{version}.dmg"
|
643
652
|
|
644
|
-
host
|
653
|
+
host[:type] = 'aio' #we are installing agent, so we want aio type
|
654
|
+
|
655
|
+
variant, version, arch, codename = host['platform'].to_array
|
656
|
+
agent_version = opts[:puppet_agent_version] || 'latest'
|
657
|
+
pkg_name = "puppet-agent-#{agent_version}*"
|
658
|
+
if agent_version == 'latest'
|
659
|
+
dmg_name = "puppet-agent-#{agent_version}.dmg"
|
660
|
+
on host, "curl -O #{opts[:mac_download_url]}/#{dmg_name}"
|
661
|
+
else
|
662
|
+
dmg_name = "puppet-agent-#{agent_version}-osx-#{version}-x86_64.dmg"
|
663
|
+
on host, "curl -O #{opts[:mac_download_url]}/#{opts[:puppet_collection]}/#{dmg_name}"
|
664
|
+
end
|
665
|
+
|
666
|
+
host.install_package(pkg_name)
|
645
667
|
|
646
668
|
configure_foss_defaults_on( host )
|
647
669
|
end
|
@@ -941,12 +963,14 @@ module Beaker
|
|
941
963
|
end
|
942
964
|
|
943
965
|
# Install development repo of the puppet-agent on the given host(s). Downloaded from
|
944
|
-
# location of the form
|
966
|
+
# location of the form DEV_BUILDS_URL/puppet-agent/AGENT_VERSION/repos
|
945
967
|
#
|
946
968
|
# @param [Host, Array<Host>, String, Symbol] hosts One or more hosts to act upon,
|
947
969
|
# or a role (String or Symbol) that identifies one or more hosts.
|
948
970
|
# @param [Hash{Symbol=>String}] opts An options hash
|
949
|
-
# @option opts [String] :
|
971
|
+
# @option opts [String] :puppet_agent_version The version of puppet-agent to install
|
972
|
+
# @option opts [String] :puppet_agent_sha The sha of puppet-agent to install, defaults to provided
|
973
|
+
# puppet_agent_version
|
950
974
|
# @option opts [String] :copy_base_local Directory where puppet-agent artifact
|
951
975
|
# will be stored locally
|
952
976
|
# (default: 'tmp/repo_configs')
|
@@ -954,18 +978,35 @@ module Beaker
|
|
954
978
|
# artifact will be pushed to on the external machine
|
955
979
|
# (default: '/root')
|
956
980
|
# @option opts [String] :puppet_collection Defaults to 'PC1'
|
957
|
-
# @option opts [String] :
|
981
|
+
# @option opts [String] :dev_builds_url Base URL to pull artifacts from
|
982
|
+
# @option opts [String] :copy_base_local Directory where puppet-agent artifact
|
983
|
+
# will be stored locally
|
984
|
+
# (default: 'tmp/repo_configs')
|
985
|
+
# @option opts [String] :copy_dir_external Directory where puppet-agent
|
986
|
+
# artifact will be pushed to on the external machine
|
987
|
+
# (default: '/root')
|
958
988
|
#
|
959
989
|
# @note on windows, the +:ruby_arch+ host parameter can determine in addition
|
960
990
|
# to other settings whether the 32 or 64bit install is used
|
961
991
|
#
|
992
|
+
# @example
|
993
|
+
# install_puppet_agent_dev_repo_on(host, { :puppet_agent_sha => 'd3377feaeac173aada3a2c2cedd141eb610960a7', :puppet_agent_version => '1.1.1.225.gd3377fe' })
|
994
|
+
#
|
962
995
|
# @return nil
|
963
|
-
def
|
996
|
+
def install_puppet_agent_dev_repo_on( hosts, opts )
|
964
997
|
|
998
|
+
opts[:puppet_agent_version] ||= opts[:version] #backward compatability
|
999
|
+
if not opts[:puppet_agent_version]
|
1000
|
+
raise "must provide :puppet_agent_version (puppet-agent version) for install_puppet_agent_dev_repo_on"
|
1001
|
+
end
|
965
1002
|
block_on hosts do |host|
|
1003
|
+
variant, version, arch, codename = host['platform'].to_array
|
1004
|
+
opts = FOSS_DEFAULT_DOWNLOAD_URLS.merge(opts)
|
1005
|
+
opts[:download_url] = "#{opts[:dev_builds_url]}/puppet-agent/#{ opts[:puppet_agent_sha] || opts[:puppet_agent_version] }/repos/"
|
966
1006
|
opts[:copy_base_local] ||= File.join('tmp', 'repo_configs')
|
967
1007
|
opts[:copy_dir_external] ||= File.join('/', 'root')
|
968
1008
|
opts[:puppet_collection] ||= 'PC1'
|
1009
|
+
host[:type] = 'aio' #we are installing agent, so we want aio type
|
969
1010
|
release_path = opts[:download_url]
|
970
1011
|
variant, version, arch, codename = host['platform'].to_array
|
971
1012
|
copy_dir_local = File.join(opts[:copy_base_local], variant)
|
@@ -975,10 +1016,13 @@ module Beaker
|
|
975
1016
|
when /^(fedora|el|centos|sles)$/
|
976
1017
|
variant = ((variant == 'centos') ? 'el' : variant)
|
977
1018
|
release_path << "#{variant}/#{version}/#{opts[:puppet_collection]}/#{arch}"
|
978
|
-
release_file = "puppet-agent-#{opts[:
|
1019
|
+
release_file = "puppet-agent-#{opts[:puppet_agent_version]}-1.#{variant}#{version}.#{arch}.rpm"
|
979
1020
|
when /^(debian|ubuntu|cumulus)$/
|
1021
|
+
if arch == 'x86_64'
|
1022
|
+
arch = 'amd64'
|
1023
|
+
end
|
980
1024
|
release_path << "deb/#{codename}/#{opts[:puppet_collection]}"
|
981
|
-
release_file = "puppet-agent_#{opts[:
|
1025
|
+
release_file = "puppet-agent_#{opts[:puppet_agent_version]}-1#{codename}_#{arch}.deb"
|
982
1026
|
when /^windows$/
|
983
1027
|
release_path << 'windows'
|
984
1028
|
onhost_copy_base = '`cygpath -smF 35`/'
|
@@ -989,6 +1033,11 @@ module Beaker
|
|
989
1033
|
# - we do not have install_32 set globally
|
990
1034
|
arch_suffix = should_install_64bit ? '64' : '86'
|
991
1035
|
release_file = "puppet-agent-x#{arch_suffix}.msi"
|
1036
|
+
when /^osx$/
|
1037
|
+
onhost_copy_base = File.join('/var', 'root')
|
1038
|
+
mac_pkg_name = "puppet-agent-#{opts[:puppet_agent_version]}"
|
1039
|
+
release_path << "/apple/#{opts[:puppet_collection]}"
|
1040
|
+
release_file = "#{mac_pkg_name}-#{variant}-#{version}-x86_64.dmg"
|
992
1041
|
else
|
993
1042
|
raise "No repository installation step for #{variant} yet..."
|
994
1043
|
end
|
@@ -1007,10 +1056,13 @@ module Beaker
|
|
1007
1056
|
result = on host, "echo #{onhost_copied_file}"
|
1008
1057
|
onhost_copied_file = result.raw_output.chomp
|
1009
1058
|
on host, Command.new("start /w #{onhost_copied_file}", [], { :cmdexe => true })
|
1059
|
+
when /^osx$/
|
1060
|
+
host.install_package("#{mac_pkg_name}*")
|
1010
1061
|
end
|
1011
|
-
|
1062
|
+
configure_foss_defaults_on( host )
|
1012
1063
|
end
|
1013
1064
|
end
|
1065
|
+
alias_method :install_puppetagent_dev_repo, :install_puppet_agent_dev_repo_on
|
1014
1066
|
|
1015
1067
|
# Install shared repo of the puppet-agent on the given host(s). Downloaded from
|
1016
1068
|
# location of the form PE_PROMOTED_BUILDS_URL/PE_VER/puppet-agent/AGENT_VERSION/repo
|
@@ -1018,8 +1070,7 @@ module Beaker
|
|
1018
1070
|
# @param [Host, Array<Host>, String, Symbol] hosts One or more hosts to act upon,
|
1019
1071
|
# or a role (String or Symbol) that identifies one or more hosts.
|
1020
1072
|
# @param [Hash{Symbol=>String}] opts An options hash
|
1021
|
-
# @option opts [String] :
|
1022
|
-
# @option opts [String] :sha The sha of puppet-agent to install
|
1073
|
+
# @option opts [String] :puppet_agent_version The version of puppet-agent to install, defaults to 'latest'
|
1023
1074
|
# @option opts [String] :pe_ver The version of PE (will also use host['pe_ver']), defaults to '4.0'
|
1024
1075
|
# @option opts [String] :copy_base_local Directory where puppet-agent artifact
|
1025
1076
|
# will be stored locally
|
@@ -1034,53 +1085,82 @@ module Beaker
|
|
1034
1085
|
# to other settings whether the 32 or 64bit install is used
|
1035
1086
|
#
|
1036
1087
|
# @example
|
1037
|
-
# install_puppet_agent_pe_promoted_repo_on(host, { :
|
1088
|
+
# install_puppet_agent_pe_promoted_repo_on(host, { :puppet_agent_version => '1.1.0.227', :pe_ver => '4.0.0-rc1'})
|
1038
1089
|
#
|
1039
1090
|
# @return nil
|
1040
1091
|
def install_puppet_agent_pe_promoted_repo_on( hosts, opts )
|
1092
|
+
opts[:puppet_agent_version] ||= 'latest'
|
1041
1093
|
block_on hosts do |host|
|
1042
1094
|
pe_ver = host[:pe_ver] || opts[:pe_ver] || '4.0'
|
1043
1095
|
variant, version, arch, codename = host['platform'].to_array
|
1044
1096
|
opts = FOSS_DEFAULT_DOWNLOAD_URLS.merge(opts)
|
1045
|
-
opts[:download_url] = "#{opts[:pe_promoted_builds_url]}/puppet-agent/#{pe_ver}/#{opts[:
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1097
|
+
opts[:download_url] = "#{opts[:pe_promoted_builds_url]}/puppet-agent/#{ pe_ver }/#{ opts[:puppet_agent_version] }/repos/"
|
1098
|
+
opts[:copy_base_local] ||= File.join('tmp', 'repo_configs')
|
1099
|
+
opts[:copy_dir_external] ||= File.join('/', 'root')
|
1100
|
+
opts[:puppet_collection] ||= 'PC1'
|
1101
|
+
host[:type] = 'aio' #we are installing agent, so we want aio type
|
1102
|
+
release_path = opts[:download_url]
|
1103
|
+
variant, version, arch, codename = host['platform'].to_array
|
1104
|
+
copy_dir_local = File.join(opts[:copy_base_local], variant)
|
1105
|
+
onhost_copy_base = opts[:copy_dir_external]
|
1049
1106
|
|
1107
|
+
case variant
|
1108
|
+
when /^(fedora|el|centos|sles)$/
|
1109
|
+
variant = ((variant == 'centos') ? 'el' : variant)
|
1110
|
+
release_file = "/repos/#{variant}/#{version}/#{opts[:puppet_collection]}/#{arch}/puppet-agent-*.rpm"
|
1111
|
+
download_file = "puppet-agent-#{variant}-#{version}-#{arch}.tar.gz"
|
1112
|
+
when /^(debian|ubuntu|cumulus)$/
|
1113
|
+
if arch == 'x86_64'
|
1114
|
+
arch = 'amd64'
|
1115
|
+
end
|
1116
|
+
release_file = "/repos/apt/#{codename}/pool/#{opts[:puppet_collection]}/p/puppet-agent/puppet-agent*#{arch}.deb"
|
1117
|
+
download_file = "puppet-agent-#{variant}-#{version}-#{arch}.tar.gz"
|
1118
|
+
when /^windows$/
|
1119
|
+
onhost_copy_base = '`cygpath -smF 35`/'
|
1120
|
+
is_config_32 = host['ruby_arch'] == 'x86' || host['install_32'] || opts['install_32']
|
1121
|
+
should_install_64bit = host.is_x86_64? && !is_config_32
|
1122
|
+
# only install 64bit builds if
|
1123
|
+
# - we do not have install_32 set on host
|
1124
|
+
# - we do not have install_32 set globally
|
1125
|
+
arch_suffix = should_install_64bit ? '64' : '86'
|
1126
|
+
release_path += "windows/"
|
1127
|
+
release_file = "/puppet-agent-x#{arch_suffix}.msi"
|
1128
|
+
download_file = "puppet-agent-x#{arch_suffix}.msi"
|
1129
|
+
when /^osx$/
|
1130
|
+
onhost_copy_base = File.join('/var', 'root')
|
1131
|
+
release_file = "/repos/apple/#{opts[:puppet_collection]}/puppet-agent-*"
|
1132
|
+
download_file = "puppet-agent-#{variant}-#{version}.tar.gz"
|
1133
|
+
else
|
1134
|
+
raise "No pe-promoted installation step for #{variant} yet..."
|
1135
|
+
end
|
1050
1136
|
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
def install_puppet_agent_dev_repo_on( hosts, opts )
|
1076
|
-
block_on hosts do |host|
|
1077
|
-
variant, version, arch, codename = host['platform'].to_array
|
1078
|
-
opts = FOSS_DEFAULT_DOWNLOAD_URLS.merge(opts)
|
1079
|
-
opts[:download_url] = "#{opts[:dev_builds_url]}/puppet-agent/#{opts[:sha]}/repos/"
|
1080
|
-
install_puppet_agent_repo_on( host, opts )
|
1137
|
+
onhost_copied_download = File.join(onhost_copy_base, download_file)
|
1138
|
+
onhost_copied_file = File.join(onhost_copy_base, release_file)
|
1139
|
+
fetch_http_file( release_path, download_file, copy_dir_local)
|
1140
|
+
scp_to host, File.join(copy_dir_local, download_file), onhost_copy_base
|
1141
|
+
|
1142
|
+
case variant
|
1143
|
+
when /^(fedora|el|centos|sles)$/
|
1144
|
+
on host, "tar -zxvf #{onhost_copied_download} -C #{onhost_copy_base}"
|
1145
|
+
on host, "rpm -ivh #{onhost_copied_file}"
|
1146
|
+
when /^(debian|ubuntu|cumulus)$/
|
1147
|
+
on host, "tar -zxvf #{onhost_copied_download} -C #{onhost_copy_base}"
|
1148
|
+
on host, "dpkg -i --force-all #{onhost_copied_file}"
|
1149
|
+
on host, "apt-get update"
|
1150
|
+
when /^windows$/
|
1151
|
+
result = on host, "echo #{onhost_copied_file}"
|
1152
|
+
onhost_copied_file = result.raw_output.chomp
|
1153
|
+
on host, Command.new("start /w #{onhost_copied_file}", [], { :cmdexe => true })
|
1154
|
+
when /^osx$/
|
1155
|
+
on host, "tar -zxvf #{onhost_copied_download} -C #{onhost_copy_base}"
|
1156
|
+
# move to better location
|
1157
|
+
on host, "mv #{onhost_copied_file}.dmg ."
|
1158
|
+
host.install_package("puppet-agent-*")
|
1159
|
+
end
|
1160
|
+
configure_foss_defaults_on( host )
|
1081
1161
|
end
|
1082
1162
|
end
|
1083
|
-
|
1163
|
+
|
1084
1164
|
|
1085
1165
|
# This method will install a pem file certifcate on a windows host
|
1086
1166
|
#
|
@@ -415,7 +415,10 @@ module Beaker
|
|
415
415
|
install_hosts.each do |host|
|
416
416
|
if agent_only_check_needed && hosts_agent_only.include?(host)
|
417
417
|
host['type'] = 'aio'
|
418
|
-
install_puppet_agent_pe_promoted_repo_on(host, opts
|
418
|
+
install_puppet_agent_pe_promoted_repo_on(host, { :puppet_agent_version => opts[:puppet_agent_version],
|
419
|
+
:puppet_agent_sha => opts[:puppet_agent_sha],
|
420
|
+
:pe_ver => opts[:pe_ver],
|
421
|
+
:puppet_collection => opts[:puppet_collection] })
|
419
422
|
setup_defaults_and_config_helper_on(host, master, [0, 1])
|
420
423
|
elsif host['platform'] =~ /windows/
|
421
424
|
on host, installer_cmd(host, opts)
|
@@ -542,11 +545,12 @@ module Beaker
|
|
542
545
|
# @param [Host, Array<Host>, String, Symbol] hosts One or more hosts to act upon,
|
543
546
|
# or a role (String or Symbol) that identifies one or more hosts.
|
544
547
|
# @!macro common_opts
|
545
|
-
# @option opts [String] :
|
546
|
-
# only hosts on 4.0+
|
547
|
-
# @option opts [String] :version Version of puppet-agent to install. Required for PE agent
|
548
|
+
# @option opts [String] :puppet_agent_version Version of puppet-agent to install. Required for PE agent
|
548
549
|
# only hosts on 4.0+
|
550
|
+
# @option opts [String] :puppet_agent_sha The sha of puppet-agent to install, defaults to puppet-agent-version.
|
551
|
+
# Required for PE agent only hosts on 4.0+
|
549
552
|
# @option opts [String] :pe_ver The version of PE (will also use host['pe_ver']), defaults to '4.0'
|
553
|
+
# @option opts [String] :puppet_collection The puppet collection for puppet-agent install.
|
550
554
|
#
|
551
555
|
# @example
|
552
556
|
# install_pe_on(hosts, {})
|
data/lib/beaker/host.rb
CHANGED
@@ -400,22 +400,28 @@ module Beaker
|
|
400
400
|
|
401
401
|
Rsync.host = hostname_with_user
|
402
402
|
|
403
|
-
|
404
|
-
|
405
|
-
|
403
|
+
# vagrant uses temporary ssh configs in order to use dynamic keys
|
404
|
+
# without this config option using ssh may prompt for password
|
405
|
+
if ssh_opts[:config] and File.exists?(ssh_opts[:config])
|
406
|
+
ssh_args << "-F #{ssh_opts[:config]}"
|
407
|
+
else
|
408
|
+
if ssh_opts.has_key?('keys') and
|
409
|
+
ssh_opts.has_key?('auth_methods') and
|
410
|
+
ssh_opts['auth_methods'].include?('publickey')
|
406
411
|
|
407
|
-
|
412
|
+
key = ssh_opts['keys']
|
408
413
|
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
414
|
+
# If an array was set, then we use the first value
|
415
|
+
if key.is_a? Array
|
416
|
+
key = key.first
|
417
|
+
end
|
413
418
|
|
414
|
-
|
415
|
-
|
416
|
-
|
419
|
+
# We need to expand tilde manually as rsync can be
|
420
|
+
# funny sometimes
|
421
|
+
key = File.expand_path(key)
|
417
422
|
|
418
|
-
|
423
|
+
ssh_args << "-i #{key}"
|
424
|
+
end
|
419
425
|
end
|
420
426
|
|
421
427
|
if ssh_opts.has_key?(:port)
|