beaker-pe 1.40.0 → 1.40.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/lib/beaker-pe/install/pe_utils.rb +14 -0
- data/lib/beaker-pe/version.rb +1 -1
- data/spec/beaker-pe/install/pe_utils_spec.rb +32 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d2f3a830172fb8639723a327bbb42f4b2653c2c
|
4
|
+
data.tar.gz: 94c9fce23f9dc3c23a25e0c8f9b868247d6024ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 726297dc8a378882eecbb8e6432e087770e5cc5c4b52d3dbc911e57c72959e9df464c26c17ebad402501596c4c52d587f16d0da62dde56cf908e37c092f9ddb7
|
7
|
+
data.tar.gz: 21ea61bb695784c515e407ebc74f7d4fa971e74a6b1f090a1122a8733ac7901b193c1622e91a94624d6dbce7c90127811dd7b831fcff9ce93539f3e46f03699c
|
data/Gemfile
CHANGED
@@ -22,6 +22,8 @@ if ENV['GEM_SOURCE'] =~ /artifactory\.delivery\.puppetlabs\.net/
|
|
22
22
|
gem "scooter", *location_for(ENV['SCOOTER_VERSION'] || '~> 3.0')
|
23
23
|
end
|
24
24
|
|
25
|
+
gem 'deep_merge'
|
26
|
+
|
25
27
|
if File.exists? "#{__FILE__}.local"
|
26
28
|
eval(File.read("#{__FILE__}.local"), binding)
|
27
29
|
end
|
@@ -5,6 +5,7 @@ require 'beaker-pe/install/feature_flags'
|
|
5
5
|
require "beaker-answers"
|
6
6
|
require "timeout"
|
7
7
|
require "json"
|
8
|
+
require "deep_merge"
|
8
9
|
module Beaker
|
9
10
|
module DSL
|
10
11
|
module InstallUtils
|
@@ -1106,6 +1107,16 @@ module Beaker
|
|
1106
1107
|
Beaker::DSL::InstallUtils::FeatureFlags.new(opts).register_flags!
|
1107
1108
|
end
|
1108
1109
|
|
1110
|
+
# PE 2018.1.0 has mco disabled by default. If we are running hosts with
|
1111
|
+
# roles hub or spoke then we intend to test mco. In this case we need
|
1112
|
+
# to change a setting in pe.conf to allow mco to be enabled.
|
1113
|
+
def get_mco_setting(hosts)
|
1114
|
+
if(version_is_less('2018.1', hosts[0]['pe_ver']) && (hosts.any? {|h| h['roles'].include?('hub') || h['roles'].include?('spoke')}))
|
1115
|
+
return {:answers => { 'pe_install::disable_mco' => false }}
|
1116
|
+
end
|
1117
|
+
return {}
|
1118
|
+
end
|
1119
|
+
|
1109
1120
|
# Generates a Beaker Answers object for the passed *host* and creates
|
1110
1121
|
# the answer or pe.conf configuration file on the *host* needed for
|
1111
1122
|
# installation.
|
@@ -1119,6 +1130,9 @@ module Beaker
|
|
1119
1130
|
# @param [Hash] opts The Beaker options hash
|
1120
1131
|
# @return [BeakerAnswers::Answers] the generated answers object
|
1121
1132
|
def generate_installer_conf_file_for(host, hosts, opts)
|
1133
|
+
possible_mco_enabled_setting = get_mco_setting(hosts)
|
1134
|
+
opts ||= {}
|
1135
|
+
opts = possible_mco_enabled_setting.deep_merge(opts)
|
1122
1136
|
beaker_answers_opts = setup_beaker_answers_opts(host, opts)
|
1123
1137
|
answers = BeakerAnswers::Answers.create(
|
1124
1138
|
opts[:pe_ver] || host['pe_ver'], hosts, beaker_answers_opts
|
data/lib/beaker-pe/version.rb
CHANGED
@@ -707,6 +707,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
707
707
|
'/tmp/answers',
|
708
708
|
%r{q_install=y.*q_puppetmaster_certname=#{master}}m
|
709
709
|
)
|
710
|
+
expect(subject).to receive(:get_mco_setting).and_return({})
|
710
711
|
subject.generate_installer_conf_file_for(master, hosts, opts)
|
711
712
|
end
|
712
713
|
|
@@ -718,6 +719,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
718
719
|
'/tmp/pe.conf',
|
719
720
|
%r{\{.*"puppet_enterprise::puppet_master_host": "#{master.hostname}"}m
|
720
721
|
)
|
722
|
+
expect(subject).to receive(:get_mco_setting).and_return({})
|
721
723
|
subject.generate_installer_conf_file_for(master, hosts, opts)
|
722
724
|
end
|
723
725
|
end
|
@@ -1445,6 +1447,33 @@ describe ClassMixedWithDSLInstallUtils do
|
|
1445
1447
|
end
|
1446
1448
|
end
|
1447
1449
|
|
1450
|
+
describe 'get_mco_setting' do
|
1451
|
+
let(:master) { make_host('master', :pe_ver => '2018.1.0', :platform => 'ubuntu-16.04-x86_64', :roles => ['master', 'database', 'dashboard']) }
|
1452
|
+
let(:hub) { make_host('agent', :pe_ver => '2018.1', :platform => 'el-7-x86_64', :roles => ['frictionless', 'hub', 'agent']) }
|
1453
|
+
let(:spoke) { make_host('agent', :pe_ver => '2018.1', :roles => ['frictionless', 'spoke', 'agent']) }
|
1454
|
+
|
1455
|
+
it 'returns mco enabled with both hub and spoke and version is greater' do
|
1456
|
+
hosts = [master, hub, spoke]
|
1457
|
+
allow(subject).to receive(:version_is_less).and_return(true)
|
1458
|
+
expect(subject.get_mco_setting(hosts)).to eq({:answers => {'pe_install::disable_mco' => false}})
|
1459
|
+
end
|
1460
|
+
it 'returns mco enabled with just hub and version is greater' do
|
1461
|
+
hosts = [master, hub]
|
1462
|
+
allow(subject).to receive(:version_is_less).and_return(true)
|
1463
|
+
expect(subject.get_mco_setting(hosts)).to eq({:answers => {'pe_install::disable_mco' => false}})
|
1464
|
+
end
|
1465
|
+
it 'returns mco enabled with just spoke and version is greater' do
|
1466
|
+
hosts = [master, spoke]
|
1467
|
+
allow(subject).to receive(:version_is_less).and_return(true)
|
1468
|
+
expect(subject.get_mco_setting(hosts)).to eq({:answers => {'pe_install::disable_mco' => false}})
|
1469
|
+
end
|
1470
|
+
it 'does not return anything if the version is less' do
|
1471
|
+
hosts = [master, hub, spoke]
|
1472
|
+
allow(subject).to receive(:version_is_less).and_return(false)
|
1473
|
+
expect(subject.get_mco_setting(hosts)).to eq({})
|
1474
|
+
end
|
1475
|
+
end
|
1476
|
+
|
1448
1477
|
describe '#deploy_frictionless_to_master' do
|
1449
1478
|
let(:master) { make_host('master', :pe_ver => '2017.2', :platform => 'ubuntu-16.04-x86_64', :roles => ['master', 'database', 'dashboard']) }
|
1450
1479
|
let(:agent) { make_host('agent', :pe_ver => '2017.2', :platform => 'el-7-x86_64', :roles => ['frictionless']) }
|
@@ -1488,6 +1517,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
1488
1517
|
end
|
1489
1518
|
|
1490
1519
|
it 'can perform a simple installation' do
|
1520
|
+
expect(subject).to receive(:get_mco_setting).and_return({})
|
1491
1521
|
allow( subject ).to receive( :verify_network_resources).with(hosts, nil)
|
1492
1522
|
allow( subject ).to receive( :on ).and_return( Beaker::Result.new( {}, '' ) )
|
1493
1523
|
allow( subject ).to receive( :fetch_pe ).and_return( true )
|
@@ -1560,6 +1590,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
1560
1590
|
:roles => ['agent']
|
1561
1591
|
}, 1)
|
1562
1592
|
opts[:masterless] = true
|
1593
|
+
expect(subject).to receive(:get_mco_setting).and_return({})
|
1563
1594
|
|
1564
1595
|
allow( subject ).to receive( :verify_network_resources).with(hosts, nil)
|
1565
1596
|
allow( subject ).to receive( :hosts ).and_return( hosts )
|
@@ -1747,6 +1778,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
1747
1778
|
hosts[0][:roles] = ['master', 'database', 'dashboard']
|
1748
1779
|
hosts[1][:platform] = Beaker::Platform.new('el-6-x86_64')
|
1749
1780
|
opts[:HOSTS] = {}
|
1781
|
+
expect(subject).to receive(:get_mco_setting).and_return({})
|
1750
1782
|
hosts.each do |host|
|
1751
1783
|
opts[:HOSTS][host.name] = host
|
1752
1784
|
end
|
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.40.
|
4
|
+
version: 1.40.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppetlabs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|