beaker-pe 2.11.2 → 2.11.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 622a9132221da31a9fd6e3aacb43b0cf59c66de74b0f820e7dbe47755d2c95fc
4
- data.tar.gz: ee49a134484538884b674e8ea8647cfafc415434f0cc09a90fd049ca207c0d2a
3
+ metadata.gz: 2729fa197d07e6977316382ea5621a152a0d740a19b1bd8639101867384eb15f
4
+ data.tar.gz: 434680a7743f98182d0a2261c5151b204bd1e0439cf4532ce249bdfb93e2ac14
5
5
  SHA512:
6
- metadata.gz: 05406e9cab8f69de5e71b44bf0962e2302f40b8cad21e35beaee365bb5a300fd129368f074d8a4957c0b50caa0d971d5cc2608b479fa9e275fb29df5dc1741ff
7
- data.tar.gz: fb9bd2b9a116519fead1ad2209da9bd5c152d1146aacc4f1f53c00774d29eb595dcf83c75625c0267ab16b9610ec7be1792b128a9a4de71998963cc6205c0ff7
6
+ metadata.gz: 024973babe90a837c4c86b3efecfe5792dc1610eae356a3e05abd54ecafb529640b616923aa674e51c125a4bd4405b67ab15dfaac82f391a9aa7a1cbafb5513c
7
+ data.tar.gz: 884e05b5a6a9e0c0a43420f5fa71bd5c805cc641d2b5cf5bcd3ff9eb2f359bd239c297d93e2405cad89bd06805430006d59666fb4903e9a44d78da9905f9341a
@@ -0,0 +1,8 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "13:00"
8
+ open-pull-requests-limit: 10
data/CODEOWNERS CHANGED
@@ -1,4 +1,5 @@
1
- #This Repository is maintained by both the beaker and installer teams, depending on the location of the changes
1
+ #This Repository is maintained by both the beaker, installer, and Night's Watch teams, depending on the location of the changes
2
2
  * @puppetlabs/beaker
3
3
  /lib/beaker-pe/install @puppetlabs/installer-and-management
4
+ /lib/beaker-pe/pe-client-tools @puppetlabs/night-s-watch
4
5
  /spec/beaker-pe/install @puppetlabs/installer-and-management
@@ -6,7 +6,6 @@ require "beaker-answers"
6
6
  require "timeout"
7
7
  require "json"
8
8
  require "deep_merge"
9
-
10
9
  module Beaker
11
10
  module DSL
12
11
  module InstallUtils
@@ -292,7 +291,7 @@ module Beaker
292
291
  fetch_and_push_pe(host, path, filename, extension)
293
292
  else
294
293
  curlopts = opts[:use_proxy] ? " --proxy #{opts[:proxy_hostname]}:3128" : ""
295
- on host, "cd #{host['working_dir']}; curl -O #{path}/#{filename}#{extension}#{curlopts}"
294
+ on host, "cd #{host['working_dir']}; curl -L -O #{path}/#{filename}#{extension}#{curlopts}"
296
295
  end
297
296
  end
298
297
  end
@@ -328,7 +327,7 @@ module Beaker
328
327
  on host, "cd #{host['working_dir']}; chmod 644 #{filename}#{extension}"
329
328
  elsif host.is_cygwin?
330
329
  curlopts = opts[:use_proxy] ? " --proxy #{opts[:proxy_hostname]}:3128" : ""
331
- on host, "cd #{host['working_dir']}; curl -O #{path}/#{filename}#{extension}#{curlopts}"
330
+ on host, "cd #{host['working_dir']}; curl -L -O #{path}/#{filename}#{extension}#{curlopts}"
332
331
  else
333
332
  on host, powershell("$webclient = New-Object System.Net.WebClient; $webclient.DownloadFile('#{path}/#{filename}#{extension}','#{host['working_dir']}\\#{filename}#{extension}')")
334
333
  end
@@ -381,7 +380,7 @@ module Beaker
381
380
  command_file_push = 'cat '
382
381
  else
383
382
  curlopts = opts[:use_proxy] ? "--proxy #{opts[:proxy_hostname]}:3128 " : ""
384
- command_file_push = "curl #{curlopts}#{path}/"
383
+ command_file_push = "curl -L #{curlopts}#{path}/"
385
384
  end
386
385
  on host, "cd #{host['working_dir']}; #{command_file_push}#{filename}#{extension} | #{unpack}"
387
386
 
@@ -582,6 +581,8 @@ module Beaker
582
581
  do_install_pe_with_pe_managed_external_postgres(hosts,opts)
583
582
  when :simple_monolithic
584
583
  simple_monolithic_install(hosts.first, hosts.drop(1), opts)
584
+ when :simple_monolithic_install_with_preload
585
+ simple_monolithic_install_with_preload(hosts.first, hosts.drop(1), opts)
585
586
  when :simple_split
586
587
  # This isn't implemented yet, so just do a generic install instead
587
588
  #simple_split_install(hosts, opts)
@@ -628,7 +629,11 @@ module Beaker
628
629
 
629
630
  mono_roles = ['master', 'database', 'dashboard']
630
631
  if has_all_roles?(hosts.first, mono_roles) && hosts.drop(1).all? {|host| host['roles'].include?('frictionless')}
631
- :simple_monolithic
632
+ if hosts.first['template'] =~ /-preload/ && opts[:type] != :upgrade
633
+ :simple_monolithic_install_with_preload
634
+ else
635
+ :simple_monolithic
636
+ end
632
637
  elsif hosts[0]['roles'].include?('master') && hosts[1]['roles'].include?('database') && hosts[2]['roles'].include?('dashboard') && hosts.drop(3).all? {|host| host['roles'].include?('frictionless')}
633
638
  :simple_split
634
639
  elsif hosts.any? {|host| host['roles'].include?('pe_postgres')}
@@ -683,6 +688,37 @@ module Beaker
683
688
  end
684
689
  end
685
690
 
691
+ # Configure PE on a monolithic master and some number of frictionless agents if a node is using a PE preloaded image for the master node.
692
+ # @param [Host] master The node to configure the master on
693
+ # @param [Array<Host>] agents The nodes to install agents on
694
+ # @param [Hash{Symbol=>Symbol, String}] opts The options for how to install or upgrade PE
695
+ #
696
+ # @example
697
+ # simple_monolithic_install_with_preload(master, agents, {:type => :install, :pe_ver => '2017.2.0'})
698
+ #
699
+ # @return nil
700
+ #
701
+ # @api private
702
+ def simple_monolithic_install_with_preload(master, agents, opts={})
703
+ step "Performing a standard monolithic install with frictionless agents on a preloaded image"
704
+ all_hosts = [master, *agents]
705
+ configure_type_defaults_on([master])
706
+
707
+ # Set PE distribution on the agents, creates working directories
708
+ prepare_hosts(all_hosts, opts)
709
+ register_feature_flags!(opts)
710
+ generate_installer_conf_file_for(master, all_hosts, opts)
711
+
712
+ step "Stop agent on master" do
713
+ stop_agent_on(master)
714
+ end
715
+
716
+ if manage_puppet_service?(master[:pe_ver], options)
717
+ configure_puppet_agent_service(:ensure => 'stopped', :enabled => false)
718
+ end
719
+
720
+ install_agents_only_on(agents, opts)
721
+ end
686
722
 
687
723
  # Configure the master to use a proxy and drop unproxied connections
688
724
  def config_hosts_for_proxy_access hosts
@@ -127,6 +127,7 @@ module Beaker
127
127
  #TODO does this need to be more detailed to pass exit codes????
128
128
  # TODO make batch file direct output to separate file
129
129
  batch_contents =<<-EOS
130
+ @echo off
130
131
  call #{tool_executable} #{args.join(' ')}
131
132
  EOS
132
133
 
@@ -47,6 +47,15 @@ module Beaker
47
47
  else
48
48
  install_dev_repos_on(product, host, directory, '/tmp/repo_configs',{:dev_builds_url => opts[:dev_builds_url]})
49
49
  host.install_package('pe-client-tools')
50
+ if host['platform'] =~ /cisco|centos|redhat|eos|sles|el-|fedora-(2[2-9]|3[0-9])/
51
+ host.exec(Command.new('rpm -q pe-client-tools')) do |command|
52
+ raise "Wanted version not installed." unless command.stdout =~ /-#{opts[:pe_client_tools_version]}/
53
+ end
54
+ elsif host['platform'] =~ /ubuntu|debian|cumulus|huaweios/
55
+ host.exec(Command.new("apt-cache policy pe-client-tools | sed -n -e 's/Installed: //p'")) do |command|
56
+ raise "Wanted version not installed." unless command.stdout =~ /-#{opts[:pe_client_tools_version]}/
57
+ end
58
+ end
50
59
  end
51
60
  end
52
61
  end
@@ -3,7 +3,7 @@ module Beaker
3
3
  module PE
4
4
 
5
5
  module Version
6
- STRING = '2.11.2'
6
+ STRING = '2.11.7'
7
7
  end
8
8
 
9
9
  end
@@ -646,29 +646,6 @@ describe ClassMixedWithDSLInstallUtils do
646
646
  def slice_installer_options(host)
647
647
  host.host_hash.select { |k,v| [ :pe_installer_conf_file, :pe_installer_conf_setting].include?(k) }
648
648
  end
649
-
650
- context 'when version < 2016.2.0' do
651
- let(:pe_ver) { '3.8.5' }
652
-
653
- it 'sets legacy settings' do
654
- expect(slice_installer_options(host)).to eq(legacy_settings)
655
- end
656
- end
657
-
658
- context 'when version >= 2016.2.0' do
659
- let (:pe_ver) { '2016.2.0' }
660
-
661
- it 'test use_meep?' do
662
- expect(subject.use_meep?('3.8.5')).to eq(false)
663
- expect(subject.use_meep?('2016.1.2')).to eq(false)
664
- expect(subject.use_meep?('2016.2.0')).to eq(true)
665
- expect(subject.use_meep?('2016.2.0-rc1-gabcdef')).to eq(true)
666
- end
667
-
668
- it 'sets meep settings' do
669
- expect(slice_installer_options(host)).to eq(meep_settings)
670
- end
671
- end
672
649
  end
673
650
 
674
651
  RSpec.shared_examples 'test flag' do |flag_name|
@@ -1114,7 +1091,7 @@ describe ClassMixedWithDSLInstallUtils do
1114
1091
  path = unixhost['pe_dir']
1115
1092
  filename = "#{ unixhost['dist'] }"
1116
1093
  extension = '.tar'
1117
- expect( subject ).to receive( :on ).with( unixhost, "cd #{ unixhost['working_dir'] }; curl #{ path }/#{ filename }#{ extension } | tar -xvf -" ).once
1094
+ expect( subject ).to receive( :on ).with( unixhost, "cd #{ unixhost['working_dir'] }; curl -L #{ path }/#{ filename }#{ extension } | tar -xvf -" ).once
1118
1095
  subject.fetch_pe( [unixhost], {} )
1119
1096
  end
1120
1097
 
@@ -1144,7 +1121,7 @@ describe ClassMixedWithDSLInstallUtils do
1144
1121
  path = unixhost['pe_dir']
1145
1122
  filename = "#{ unixhost['dist'] }"
1146
1123
  extension = '.tar.gz'
1147
- expect( subject ).to receive( :on ).with( unixhost, "cd #{ unixhost['working_dir'] }; curl #{ path }/#{ filename }#{ extension } | gunzip | tar -xvf -" ).once
1124
+ expect( subject ).to receive( :on ).with( unixhost, "cd #{ unixhost['working_dir'] }; curl -L #{ path }/#{ filename }#{ extension } | gunzip | tar -xvf -" ).once
1148
1125
  subject.fetch_pe( [unixhost], {} )
1149
1126
  end
1150
1127
 
@@ -1190,7 +1167,7 @@ describe ClassMixedWithDSLInstallUtils do
1190
1167
  path = machost['pe_dir']
1191
1168
  filename = "#{ machost['dist'] }"
1192
1169
  extension = '.dmg'
1193
- expect( subject ).to receive( :on ).with( machost, "cd #{ machost['working_dir'] }; curl -O #{ path }/#{ filename }#{ extension }" ).once
1170
+ expect( subject ).to receive( :on ).with( machost, "cd #{ machost['working_dir'] }; curl -L -O #{ path }/#{ filename }#{ extension }" ).once
1194
1171
  subject.fetch_pe( [machost], {} )
1195
1172
  end
1196
1173
 
@@ -1644,6 +1621,13 @@ describe ClassMixedWithDSLInstallUtils do
1644
1621
  subject.do_install([])
1645
1622
  end
1646
1623
 
1624
+ it 'chooses to do a simple monolithic install with preload when appropriate' do
1625
+ expect(subject).to receive(:simple_monolithic_install_with_preload)
1626
+ allow(subject).to receive(:determine_install_type).and_return(:simple_monolithic_install_with_preload)
1627
+
1628
+ subject.do_install([])
1629
+ end
1630
+
1647
1631
  it 'can perform a simple installation' do
1648
1632
  expect(subject).to receive(:get_mco_setting).and_return({})
1649
1633
  allow( subject ).to receive( :verify_network_resources).with(hosts, nil)
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: 2.11.2
4
+ version: 2.11.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-11 00:00:00.000000000 Z
11
+ date: 2020-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -248,6 +248,7 @@ executables:
248
248
  extensions: []
249
249
  extra_rdoc_files: []
250
250
  files:
251
+ - ".github/dependabot.yml"
251
252
  - ".gitignore"
252
253
  - ".rspec"
253
254
  - ".simplecov"
@@ -306,7 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
306
307
  - !ruby/object:Gem::Version
307
308
  version: '0'
308
309
  requirements: []
309
- rubygems_version: 3.0.6
310
+ rubygems_version: 3.0.8
310
311
  signing_key:
311
312
  specification_version: 4
312
313
  summary: Beaker PE DSL Helpers!