beaker-pe 1.26.0 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/beaker-pe/install/pe_utils.rb +111 -59
- data/lib/beaker-pe/version.rb +1 -1
- data/spec/beaker-pe/install/pe_utils_spec.rb +97 -30
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
ZGIxMzQ2NjExMDg5MGJlODU2YWYxNmFiYTZjYmE0MDcxNTVkZGRjYw==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
OGQzMmQ1N2FiNjNjNjMwYjIwYTdkZDIzMzgwYjkwMDNjOGU5ZmJlOQ==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
ZDc4N2Y3OTk3MTc3ZDMyMThiMTdjOGU5ZmY3MGYxYTdlMGYwM2EyNWE4NzRh
|
|
10
|
+
NzMyNTY5NzM4OTBjODgyMjc2ZjExMTFhZDQyZDc3ZDU3ZGJkZTc3ZWM5MTBh
|
|
11
|
+
ZWY1NTQ3M2NiNzAxYWFhMTFmZjk1NjQ1ZGVjOGNhMzAxYWFlZmQ=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
Y2MwOWVhNjFiNzBhNzEwN2U5OGZlYzgwOWY1MGE0NTUxM2YyYWRlYmNjZGY5
|
|
14
|
+
YjE2MjM1NDdiOWU3NDgyNTk3YTZiYzZlZjlhN2RkMTIwZDdlYjVlOTU5MjA2
|
|
15
|
+
YjdiOTRjOGI2OTBiNDMyOTljNGIzNThlZjJmY2QyYTRiYzUwZWQ=
|
|
@@ -101,6 +101,30 @@ module Beaker
|
|
|
101
101
|
end
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
+
# Return agent nodes with 'lb_connect' role that are not loadbalancers
|
|
105
|
+
def loadbalancer_connecting_agents
|
|
106
|
+
lb_connect_nodes = select_hosts(roles: ['lb_connect'])
|
|
107
|
+
lb_connect_agents = lb_connect_nodes.reject { |h| h['roles'].include?('loadbalancer')}
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Returns true if loadbalncer exists and is configured with 'lb_connect' role
|
|
111
|
+
def lb_connect_loadbalancer_exists?
|
|
112
|
+
if any_hosts_as?('loadbalancer')
|
|
113
|
+
lb_node = select_hosts(roles: ['loadbalancer'])
|
|
114
|
+
lb_node.first['roles'].include?('lb_connect')
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
#Returns loadbalancer if host is an agent and loadbalancer has lb_connect role
|
|
119
|
+
#@param [Host] agent host with lb_connect role
|
|
120
|
+
def get_lb_downloadhost(host)
|
|
121
|
+
downloadhost = master
|
|
122
|
+
if !host['roles'].include?('loadbalancer') && lb_connect_loadbalancer_exists?
|
|
123
|
+
downloadhost = loadbalancer
|
|
124
|
+
end
|
|
125
|
+
downloadhost
|
|
126
|
+
end
|
|
127
|
+
|
|
104
128
|
# Generate the command line string needed to from a frictionless puppet-agent
|
|
105
129
|
# install on this host in a PE environment.
|
|
106
130
|
#
|
|
@@ -124,6 +148,14 @@ module Beaker
|
|
|
124
148
|
end
|
|
125
149
|
end
|
|
126
150
|
|
|
151
|
+
# If this is an agent node configured to connect to the loadbalancer
|
|
152
|
+
# using 'lb_connect' role, then use loadbalancer in the download url
|
|
153
|
+
# instead of master
|
|
154
|
+
downloadhost = master
|
|
155
|
+
if host['roles'].include?('lb_connect')
|
|
156
|
+
downloadhost = get_lb_downloadhost(host)
|
|
157
|
+
end
|
|
158
|
+
|
|
127
159
|
pe_debug = host[:pe_debug] || opts[:pe_debug] ? ' -x' : ''
|
|
128
160
|
use_puppet_ca_cert = host[:use_puppet_ca_cert] || opts[:use_puppet_ca_cert]
|
|
129
161
|
|
|
@@ -135,7 +167,7 @@ module Beaker
|
|
|
135
167
|
cert_validator = '[Net.ServicePointManager]::ServerCertificateValidationCallback = {\\$true}'
|
|
136
168
|
end
|
|
137
169
|
|
|
138
|
-
cmd = %Q{powershell -c "cd #{host['working_dir']};#{cert_validator};\\$webClient = New-Object System.Net.WebClient;\\$webClient.DownloadFile('https://#{
|
|
170
|
+
cmd = %Q{powershell -c "cd #{host['working_dir']};#{cert_validator};\\$webClient = New-Object System.Net.WebClient;\\$webClient.DownloadFile('https://#{downloadhost}:8140/packages/current/install.ps1', '#{host['working_dir']}/install.ps1');#{host['working_dir']}/install.ps1 -verbose #{frictionless_install_opts.join(' ')}"}
|
|
139
171
|
else
|
|
140
172
|
curl_opts = %w{--tlsv1 -O}
|
|
141
173
|
if use_puppet_ca_cert
|
|
@@ -144,7 +176,7 @@ module Beaker
|
|
|
144
176
|
curl_opts << '-k'
|
|
145
177
|
end
|
|
146
178
|
|
|
147
|
-
cmd = "FRICTIONLESS_TRACE='true'; export FRICTIONLESS_TRACE; cd #{host['working_dir']} && curl #{curl_opts.join(' ')} https://#{
|
|
179
|
+
cmd = "FRICTIONLESS_TRACE='true'; export FRICTIONLESS_TRACE; cd #{host['working_dir']} && curl #{curl_opts.join(' ')} https://#{downloadhost}:8140/packages/current/install.bash && bash#{pe_debug} install.bash #{frictionless_install_opts.join(' ')}".strip
|
|
148
180
|
end
|
|
149
181
|
|
|
150
182
|
return cmd
|
|
@@ -376,33 +408,37 @@ module Beaker
|
|
|
376
408
|
else
|
|
377
409
|
_console_dispatcher = get_console_dispatcher_for_beaker_pe!
|
|
378
410
|
|
|
379
|
-
#
|
|
380
|
-
|
|
381
|
-
# multiple hosts with the same platform
|
|
382
|
-
node_group = _console_dispatcher.get_node_group_by_name('Beaker Frictionless Agent')
|
|
383
|
-
if node_group.nil? || node_group.empty?
|
|
384
|
-
node_group = {}
|
|
385
|
-
node_group['name'] = "Beaker Frictionless Agent"
|
|
386
|
-
# Pin the master to the node
|
|
387
|
-
node_group['rule'] = [ "and", [ '=', 'name', master.to_s ]]
|
|
388
|
-
node_group['classes'] ||= {}
|
|
389
|
-
end
|
|
411
|
+
# Add pe_repo packages to 'PE Master' group
|
|
412
|
+
node_group = _console_dispatcher.get_node_group_by_name('PE Master')
|
|
390
413
|
|
|
391
414
|
# add the pe_repo platform class if it's not already present
|
|
392
|
-
if
|
|
393
|
-
node_group['classes']
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
415
|
+
if node_group
|
|
416
|
+
if !node_group['classes'].include?(klass)
|
|
417
|
+
node_group['classes'][klass] = {}
|
|
418
|
+
_console_dispatcher.create_new_node_group_model(node_group)
|
|
419
|
+
|
|
420
|
+
# The puppet agent run that will download the agent tarballs to the master can sometimes fail with
|
|
421
|
+
# curl errors if there is a network hiccup. Use beakers `retry_on` method to retry up to
|
|
422
|
+
# three times to avoid failing the entire test pipeline due to a network blip
|
|
423
|
+
retry_opts = {
|
|
424
|
+
:desired_exit_codes => [0,2],
|
|
425
|
+
:max_retries => 3,
|
|
426
|
+
# Beakers retry_on method wants the verbose value to be a string, not a bool.
|
|
427
|
+
:verbose => 'true'
|
|
428
|
+
}
|
|
429
|
+
retry_on(master, puppet("agent -t"), retry_opts)
|
|
430
|
+
|
|
431
|
+
# If we are connecting through loadbalancer, download the agent tarballs to compile masters
|
|
432
|
+
if lb_connect_loadbalancer_exists?
|
|
433
|
+
hosts.each do |h|
|
|
434
|
+
if h['roles'].include?('compile_master')
|
|
435
|
+
retry_on(h, puppet("agent -t"), retry_opts)
|
|
436
|
+
end
|
|
437
|
+
end
|
|
438
|
+
end
|
|
439
|
+
end
|
|
440
|
+
else
|
|
441
|
+
raise "Failed to add pe_repo packages, PE Master node group is not available"
|
|
406
442
|
end
|
|
407
443
|
end
|
|
408
444
|
end
|
|
@@ -507,7 +543,7 @@ module Beaker
|
|
|
507
543
|
def simple_monolithic_install(master, agents, opts={})
|
|
508
544
|
step "Performing a standard monolithic install with frictionless agents"
|
|
509
545
|
all_hosts = [master, *agents]
|
|
510
|
-
configure_type_defaults_on(
|
|
546
|
+
configure_type_defaults_on([master])
|
|
511
547
|
|
|
512
548
|
# Set PE distribution on the agents, creates working directories
|
|
513
549
|
prepare_hosts(all_hosts, opts)
|
|
@@ -518,41 +554,11 @@ module Beaker
|
|
|
518
554
|
on master, installer_cmd(master, opts)
|
|
519
555
|
end
|
|
520
556
|
|
|
521
|
-
|
|
522
|
-
agents.each do |agent|
|
|
523
|
-
# If We're *not* running the classic installer, we want
|
|
524
|
-
# to make sure the master has packages for us.
|
|
525
|
-
if agent['platform'] != master['platform'] # only need to do this if platform differs
|
|
526
|
-
deploy_frictionless_to_master(agent)
|
|
527
|
-
end
|
|
528
|
-
end
|
|
529
|
-
end
|
|
530
|
-
|
|
531
|
-
step "Install agents" do
|
|
532
|
-
block_on(agents, {:run_in_parallel => true}) do |host|
|
|
533
|
-
install_ca_cert_on(host, opts)
|
|
534
|
-
on(host, installer_cmd(host, opts))
|
|
535
|
-
end
|
|
536
|
-
end
|
|
537
|
-
|
|
538
|
-
step "Sign agent certificates" do
|
|
539
|
-
# This will sign all cert requests
|
|
540
|
-
sign_certificate_for(agents)
|
|
541
|
-
end
|
|
542
|
-
|
|
543
|
-
step "Stop puppet agents to avoid interfering with tests" do
|
|
544
|
-
stop_agent_on(all_hosts, :run_in_parallel => true)
|
|
545
|
-
end
|
|
557
|
+
install_agents_only_on(agents, opts)
|
|
546
558
|
|
|
547
559
|
step "Run puppet to setup mcollective and pxp-agent" do
|
|
548
560
|
on(master, puppet_agent('-t'), :acceptable_exit_codes => [0,2])
|
|
549
561
|
run_puppet_on_non_infrastructure_nodes(all_hosts)
|
|
550
|
-
|
|
551
|
-
#Workaround for windows frictionless install, see BKR-943 for the reason
|
|
552
|
-
agents.select {|agent| agent['platform'] =~ /windows/}.each do |agent|
|
|
553
|
-
client_datadir = agent.puppet['client_datadir']
|
|
554
|
-
on(agent, puppet("resource file \"#{client_datadir}\" ensure=absent force=true"))
|
|
555
|
-
end
|
|
556
562
|
end
|
|
557
563
|
|
|
558
564
|
step "Run puppet a second time on the primary to populate services.conf (PE-19054)" do
|
|
@@ -1549,6 +1555,52 @@ module Beaker
|
|
|
1549
1555
|
end
|
|
1550
1556
|
end
|
|
1551
1557
|
end
|
|
1558
|
+
|
|
1559
|
+
# Method to install just the agent nodes
|
|
1560
|
+
# This method can be called only after installing PE on infrastructure nodes
|
|
1561
|
+
# @param [Array] agent only nodes from Beaker hosts
|
|
1562
|
+
# @param [Hash] opts The Beaker options hash
|
|
1563
|
+
def install_agents_only_on(agent_nodes, opts)
|
|
1564
|
+
unless agent_nodes.empty?
|
|
1565
|
+
configure_type_defaults_on(agent_nodes)
|
|
1566
|
+
|
|
1567
|
+
step "Setup frictionless installer on the master" do
|
|
1568
|
+
agent_nodes.each do |agent|
|
|
1569
|
+
# If We're *not* running the classic installer, we want
|
|
1570
|
+
# to make sure the master has packages for us.
|
|
1571
|
+
if agent['platform'] != master['platform'] # only need to do this if platform differs
|
|
1572
|
+
deploy_frictionless_to_master(agent)
|
|
1573
|
+
end
|
|
1574
|
+
end
|
|
1575
|
+
end
|
|
1576
|
+
|
|
1577
|
+
step "Install agents" do
|
|
1578
|
+
block_on(agent_nodes, {:run_in_parallel => true}) do |host|
|
|
1579
|
+
install_ca_cert_on(host, opts)
|
|
1580
|
+
on(host, installer_cmd(host, opts))
|
|
1581
|
+
end
|
|
1582
|
+
end
|
|
1583
|
+
|
|
1584
|
+
step "Sign agent certificates" do
|
|
1585
|
+
# This will sign all cert requests
|
|
1586
|
+
sign_certificate_for(agent_nodes)
|
|
1587
|
+
end
|
|
1588
|
+
|
|
1589
|
+
step "Stop puppet agents to avoid interfering with tests" do
|
|
1590
|
+
stop_agent_on(agent_nodes, :run_in_parallel => true)
|
|
1591
|
+
end
|
|
1592
|
+
|
|
1593
|
+
step "Run puppet on all agent nodes" do
|
|
1594
|
+
on agent_nodes, puppet_agent('-t'), :acceptable_exit_codes => [0,2], :run_in_parallel => true
|
|
1595
|
+
end
|
|
1596
|
+
|
|
1597
|
+
#Workaround for windows frictionless install, see BKR-943
|
|
1598
|
+
agent_nodes.select {|agent| agent['platform'] =~ /windows/}.each do |agent|
|
|
1599
|
+
client_datadir = agent.puppet['client_datadir']
|
|
1600
|
+
on(agent, puppet("resource file \"#{client_datadir}\" ensure=absent force=true"))
|
|
1601
|
+
end
|
|
1602
|
+
end
|
|
1603
|
+
end
|
|
1552
1604
|
end
|
|
1553
1605
|
end
|
|
1554
1606
|
end
|
data/lib/beaker-pe/version.rb
CHANGED
|
@@ -60,6 +60,17 @@ describe ClassMixedWithDSLInstallUtils do
|
|
|
60
60
|
:working_dir => '/tmp',
|
|
61
61
|
:dist => 'puppet-enterprise-3.7.1-rc0-78-gffc958f-eos-4-i386' } ) }
|
|
62
62
|
|
|
63
|
+
let(:lei_hosts) { make_hosts( { :pe_ver => '3.0',
|
|
64
|
+
:platform => 'linux',
|
|
65
|
+
:roles => [ 'agent' ],
|
|
66
|
+
:type => 'pe'}, 4 ) }
|
|
67
|
+
let(:lb_test_hosts) { lei_hosts[0][:roles] = ['master', 'database', 'dashboard']
|
|
68
|
+
lei_hosts[1][:roles] = ['loadbalancer', 'lb_connect']
|
|
69
|
+
lei_hosts[2][:roles] = ['compile_master']
|
|
70
|
+
lei_hosts[3][:roles] = ['frictionless', 'lb_connect']
|
|
71
|
+
lei_hosts[3][:working_dir] = '/tmp'
|
|
72
|
+
lei_hosts }
|
|
73
|
+
|
|
63
74
|
context '#prep_host_for_upgrade' do
|
|
64
75
|
|
|
65
76
|
it 'sets per host options before global options' do
|
|
@@ -188,6 +199,26 @@ describe ClassMixedWithDSLInstallUtils do
|
|
|
188
199
|
end
|
|
189
200
|
end
|
|
190
201
|
|
|
202
|
+
describe 'loadbalancer_connecting_agents' do
|
|
203
|
+
it 'no hosts are chosen if there are no agents with lb_connect role' do
|
|
204
|
+
allow( subject ).to receive(:hosts).and_return([])
|
|
205
|
+
end
|
|
206
|
+
it 'chooses agents with lb_connect role' do
|
|
207
|
+
allow( subject ).to receive(:lb_test_hosts).and_return([lb_test_hosts[3]])
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
describe 'get_lb_downloadhost' do
|
|
213
|
+
it 'choose lb_connect loadbalancer as downloadhost, if there is one' do
|
|
214
|
+
allow( subject ).to receive(:lb_test_hosts[3]).and_return([lb_test_hosts[1]])
|
|
215
|
+
end
|
|
216
|
+
it 'if there is no lb_connect loadbalancer, return master' do
|
|
217
|
+
lei_hosts[1][:roles] = ['loadbalancer']
|
|
218
|
+
allow( subject ).to receive(:lb_test_hosts[3]).and_return([lb_test_hosts[0]])
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
|
|
191
222
|
describe 'frictionless_agent_installer_cmd' do
|
|
192
223
|
let(:host) do
|
|
193
224
|
the_host = unixhost.dup
|
|
@@ -265,6 +296,18 @@ describe ClassMixedWithDSLInstallUtils do
|
|
|
265
296
|
"\""
|
|
266
297
|
expect( subject.frictionless_agent_installer_cmd( host, {}, '2016.4.0' ) ).to eq(expecting)
|
|
267
298
|
end
|
|
299
|
+
|
|
300
|
+
it 'generates a frictionless install command with loadbalancer as download host' do
|
|
301
|
+
hosts = lb_test_hosts
|
|
302
|
+
expect( subject ).to receive( :get_lb_downloadhost ).with(lb_test_hosts[3]).and_return( 'testloadbalancer' )
|
|
303
|
+
expecting = [
|
|
304
|
+
"FRICTIONLESS_TRACE='true'",
|
|
305
|
+
"export FRICTIONLESS_TRACE",
|
|
306
|
+
"cd /tmp && curl --tlsv1 -O -k https://testloadbalancer:8140/packages/current/install.bash && bash install.bash"
|
|
307
|
+
].join("; ")
|
|
308
|
+
|
|
309
|
+
expect( subject.frictionless_agent_installer_cmd( lb_test_hosts[3], {}, '2016.4.0' ) ).to eq(expecting)
|
|
310
|
+
end
|
|
268
311
|
end
|
|
269
312
|
|
|
270
313
|
describe 'install_ca_cert_on' do
|
|
@@ -1079,8 +1122,9 @@ describe ClassMixedWithDSLInstallUtils do
|
|
|
1079
1122
|
describe '#deploy_frictionless_to_master' do
|
|
1080
1123
|
let(:master) { make_host('master', :pe_ver => '2017.2', :platform => 'ubuntu-16.04-x86_64', :roles => ['master', 'database', 'dashboard']) }
|
|
1081
1124
|
let(:agent) { make_host('agent', :pe_ver => '2017.2', :platform => 'el-7-x86_64', :roles => ['frictionless']) }
|
|
1125
|
+
let(:compile_master) { make_host('agent', :pe_ver => '2017.2', :roles => ['frictionless', 'compile_master']) }
|
|
1082
1126
|
let(:dispatcher) { double('dispatcher') }
|
|
1083
|
-
let(:node_group) { {} }
|
|
1127
|
+
let(:node_group) { { 'classes' => {} } }
|
|
1084
1128
|
|
|
1085
1129
|
before :each do
|
|
1086
1130
|
allow(subject).to receive(:retry_on)
|
|
@@ -1090,12 +1134,12 @@ describe ClassMixedWithDSLInstallUtils do
|
|
|
1090
1134
|
|
|
1091
1135
|
allow(dispatcher).to receive(:get_node_group_by_name).and_return(node_group)
|
|
1092
1136
|
allow(dispatcher).to receive(:create_new_node_group_model) {|model| node_group.update(model)}
|
|
1137
|
+
allow(subject).to receive(:compile_masters).and_return([compile_master])
|
|
1093
1138
|
end
|
|
1094
1139
|
|
|
1095
|
-
it 'adds the right pe_repo class to the
|
|
1140
|
+
it 'adds the right pe_repo class to the PE Master group' do
|
|
1096
1141
|
subject.deploy_frictionless_to_master(agent)
|
|
1097
1142
|
|
|
1098
|
-
expect(node_group['rule']).to eq(['and', ['=', 'name', 'master']])
|
|
1099
1143
|
expect(node_group['classes']).to include('pe_repo::platform::el_7_x86_64')
|
|
1100
1144
|
end
|
|
1101
1145
|
|
|
@@ -1449,6 +1493,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
|
1449
1493
|
allow(subject).to receive(:prepare_host_installer_options)
|
|
1450
1494
|
allow(subject).to receive(:generate_installer_conf_file_for)
|
|
1451
1495
|
allow(subject).to receive(:deploy_frictionless_to_master)
|
|
1496
|
+
allow(subject).to receive(:install_agents_only_on)
|
|
1452
1497
|
|
|
1453
1498
|
allow(subject).to receive(:installer_cmd).with(monolithic, anything()).and_return("install master")
|
|
1454
1499
|
allow(subject).to receive(:installer_cmd).with(el_agent, anything()).and_return("install el agent")
|
|
@@ -1458,44 +1503,66 @@ describe ClassMixedWithDSLInstallUtils do
|
|
|
1458
1503
|
allow(subject).to receive(:sign_certificate_for)
|
|
1459
1504
|
end
|
|
1460
1505
|
|
|
1461
|
-
describe 'configuring frictionless installer' do
|
|
1462
|
-
it "skips the master's platform" do
|
|
1463
|
-
expect(subject).not_to receive(:deploy_frictionless_to_master)
|
|
1464
|
-
|
|
1465
|
-
subject.simple_monolithic_install(monolithic, [el_agent, el_agent, el_agent])
|
|
1466
|
-
end
|
|
1467
|
-
|
|
1468
|
-
it "adds frictionless install classes for other platforms" do
|
|
1469
|
-
expect(subject).to receive(:deploy_frictionless_to_master).with(deb_agent)
|
|
1470
|
-
|
|
1471
|
-
subject.simple_monolithic_install(monolithic, [el_agent, deb_agent])
|
|
1472
|
-
end
|
|
1473
|
-
end
|
|
1474
|
-
|
|
1475
1506
|
it 'installs on the master then on the agents' do
|
|
1476
1507
|
expect(subject).to receive(:on).with(monolithic, "install master").ordered
|
|
1477
|
-
expect(subject).to receive(:
|
|
1478
|
-
|
|
1508
|
+
expect(subject).to receive(:install_agents_only_on).with([el_agent, el_agent], {}).ordered
|
|
1479
1509
|
subject.simple_monolithic_install(monolithic, [el_agent, el_agent])
|
|
1480
1510
|
end
|
|
1481
1511
|
|
|
1482
|
-
it
|
|
1483
|
-
expect(subject).to receive(:
|
|
1512
|
+
it "calls prepare_hosts on all hosts instead of just master" do
|
|
1513
|
+
expect(subject).to receive(:prepare_hosts).with([monolithic] + [el_agent, el_agent, el_agent], {})
|
|
1514
|
+
subject.simple_monolithic_install(monolithic, [el_agent, el_agent, el_agent])
|
|
1515
|
+
end
|
|
1516
|
+
end
|
|
1484
1517
|
|
|
1485
|
-
|
|
1518
|
+
describe 'install_agents_only_on' do
|
|
1519
|
+
let(:monolithic) { make_host('monolithic',
|
|
1520
|
+
:pe_ver => '2016.4',
|
|
1521
|
+
:platform => 'el-7-x86_64',
|
|
1522
|
+
:roles => ['master', 'database', 'dashboard']) }
|
|
1523
|
+
let(:agent) { make_host('agent',
|
|
1524
|
+
:pe_ver => '2016.4',
|
|
1525
|
+
:platform => 'el-7-x86_64',
|
|
1526
|
+
:roles => ['frictionless']) }
|
|
1527
|
+
before :each do
|
|
1528
|
+
allow(subject).to receive(:on)
|
|
1529
|
+
allow(subject).to receive(:hosts).and_return([monolithic, agent, agent])
|
|
1530
|
+
allow(subject).to receive(:configure_type_defaults_on)
|
|
1531
|
+
allow(subject).to receive(:deploy_frictionless_to_master)
|
|
1532
|
+
allow(subject).to receive(:stop_agent_on)
|
|
1533
|
+
allow(subject).to receive(:sign_certificate_for)
|
|
1534
|
+
allow(subject).to receive(:installer_cmd).with(agent, anything()).and_return("install agent")
|
|
1486
1535
|
end
|
|
1487
1536
|
|
|
1488
|
-
it '
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1537
|
+
it 'does not call deploy_frictionless_to_master if agent platform is same as master' do
|
|
1538
|
+
expect(subject).not_to receive(:deploy_frictionless_to_master)
|
|
1539
|
+
subject.install_agents_only_on([agent], opts)
|
|
1540
|
+
end
|
|
1492
1541
|
|
|
1493
|
-
|
|
1542
|
+
it 'calls deploy_frictionless_to_master if agent platform is different from master' do
|
|
1543
|
+
agent['platform'] = 'deb-7-x86_64'
|
|
1544
|
+
expect(subject).to receive(:deploy_frictionless_to_master)
|
|
1545
|
+
subject.install_agents_only_on([agent], opts)
|
|
1494
1546
|
end
|
|
1495
1547
|
|
|
1496
|
-
it
|
|
1497
|
-
|
|
1498
|
-
subject.
|
|
1548
|
+
it 'installs agent on agent hosts' do
|
|
1549
|
+
agents = [agent, agent]
|
|
1550
|
+
expect(subject).to receive(:block_on).with(agents, :run_in_parallel => true)
|
|
1551
|
+
subject.install_agents_only_on(agents, opts)
|
|
1552
|
+
end
|
|
1553
|
+
|
|
1554
|
+
it 'signs certificate and stops agent on agent host' do
|
|
1555
|
+
agents = [agent, agent]
|
|
1556
|
+
expect(subject).to receive(:sign_certificate_for).with(agents)
|
|
1557
|
+
expect(subject).to receive(:stop_agent_on).with(agents, :run_in_parallel => true)
|
|
1558
|
+
subject.install_agents_only_on(agents, opts)
|
|
1559
|
+
end
|
|
1560
|
+
|
|
1561
|
+
it 'runs puppet on agent hosts' do
|
|
1562
|
+
agents = [agent, agent]
|
|
1563
|
+
expect(subject).to receive(:on).with(agents, proc {
|
|
1564
|
+
|cmd| cmd.command == "puppet agent"}, hash_including(:run_in_parallel => true)).once
|
|
1565
|
+
subject.install_agents_only_on(agents, opts)
|
|
1499
1566
|
end
|
|
1500
1567
|
end
|
|
1501
1568
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: beaker-pe
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.27.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Puppetlabs
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-12-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|