beaker-pe 2.11.3 → 2.11.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49efdb6cd49c32f277ce61b91a13d90b630e5b7aff6f6033e1ee9cac9141d936
4
- data.tar.gz: 4639ff294f682e89302270b08068170675e02512a6dfe1db2b69619db1c496b0
3
+ metadata.gz: 405e2df559bbc58f3276296b09461c2fbf9096b5d88061097a69dab3877ab982
4
+ data.tar.gz: 00479874f7c314e0f5e803ecdfab2ea0158dff21648b3a08f64f9ca1d67b80bf
5
5
  SHA512:
6
- metadata.gz: e3f0b13ac514e1af721d6a038588faffcfebb1aa6e10c9eb163e4a1368b959331f0b430298f4ded142c23520a4be45aa88ca1fc0a3548b4765250d68067817b7
7
- data.tar.gz: 7753f8242e7c093b9d03d5906b6cc42624d9d11254228cabaddd90cb300297d2727959e957cc4eb68c5a3549581f62c9d5c0d4418811eaa7b8978cdcfa06f52a
6
+ metadata.gz: 99b201517f264cdd54d12d535ed683d25f90ef86c7529b5190e63091b37088d5c63169df621b8aedabd5b98510f4a65bececcbbd3efa9286120c2705f4787789
7
+ data.tar.gz: 36f09dc7bb699212210eab2385bdcebda15194f5f4f0a9796599115e6076c94e7339fd67c87fc1e41d6069ba1154ef98a5e53197b457b9845fd49700880e5d01
@@ -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
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency 'rspec-its'
23
23
  s.add_development_dependency 'fakefs', '~> 0.6', '< 0.14.0'
24
24
  s.add_development_dependency 'rake', '~> 12.3.3'
25
- s.add_development_dependency 'simplecov'
25
+ s.add_development_dependency 'simplecov', '= 0.18.5'
26
26
  s.add_development_dependency 'pry', '~> 0.10'
27
27
 
28
28
  # Documentation dependencies
@@ -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
@@ -1011,7 +1047,11 @@ module Beaker
1011
1047
  facts_result = on(master, 'puppet facts')
1012
1048
  raise ArgumentError, fail_message if facts_result.exit_code != 0
1013
1049
  facts_hash = JSON.parse(facts_result.stdout.chomp)
1014
- puppet_agent_version = facts_hash['values']['aio_agent_version']
1050
+ # In Puppet 7, facts are at the top level of the hash. Before that
1051
+ # version, they were wrapped inside a `values` key. Since we're
1052
+ # trying to determine the agent version here, we can't just switch
1053
+ # our behavior by agent version, so we check both possible locations.
1054
+ puppet_agent_version = facts_hash['aio_agent_version'] || facts_hash.dig('values', 'aio_agent_version')
1015
1055
  raise ArgumentError, fail_message if puppet_agent_version.nil?
1016
1056
  logger.warn("#{log_prefix} Read puppet-agent version #{puppet_agent_version} from master")
1017
1057
  # saving so that we don't have to query the master more than once
@@ -1580,8 +1620,7 @@ module Beaker
1580
1620
  configure_type_defaults_on(host)
1581
1621
  prepare_host_installer_options(host)
1582
1622
 
1583
- # On upgrade we don't want to update the postgre's pe.conf
1584
- unless (is_upgrade && host['roles'].include?('pe_postgres'))
1623
+ unless is_upgrade
1585
1624
  setup_pe_conf(host, hosts, opts)
1586
1625
  end
1587
1626
  end
@@ -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.3'
6
+ STRING = '2.11.8'
7
7
  end
8
8
 
9
9
  end
@@ -1091,7 +1091,7 @@ describe ClassMixedWithDSLInstallUtils do
1091
1091
  path = unixhost['pe_dir']
1092
1092
  filename = "#{ unixhost['dist'] }"
1093
1093
  extension = '.tar'
1094
- 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
1095
1095
  subject.fetch_pe( [unixhost], {} )
1096
1096
  end
1097
1097
 
@@ -1121,7 +1121,7 @@ describe ClassMixedWithDSLInstallUtils do
1121
1121
  path = unixhost['pe_dir']
1122
1122
  filename = "#{ unixhost['dist'] }"
1123
1123
  extension = '.tar.gz'
1124
- 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
1125
1125
  subject.fetch_pe( [unixhost], {} )
1126
1126
  end
1127
1127
 
@@ -1167,7 +1167,7 @@ describe ClassMixedWithDSLInstallUtils do
1167
1167
  path = machost['pe_dir']
1168
1168
  filename = "#{ machost['dist'] }"
1169
1169
  extension = '.dmg'
1170
- 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
1171
1171
  subject.fetch_pe( [machost], {} )
1172
1172
  end
1173
1173
 
@@ -1621,6 +1621,13 @@ describe ClassMixedWithDSLInstallUtils do
1621
1621
  subject.do_install([])
1622
1622
  end
1623
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
+
1624
1631
  it 'can perform a simple installation' do
1625
1632
  expect(subject).to receive(:get_mco_setting).and_return({})
1626
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.3
4
+ version: 2.11.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-13 00:00:00.000000000 Z
11
+ date: 2020-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -76,16 +76,16 @@ dependencies:
76
76
  name: simplecov
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ">="
79
+ - - '='
80
80
  - !ruby/object:Gem::Version
81
- version: '0'
81
+ version: 0.18.5
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ">="
86
+ - - '='
87
87
  - !ruby/object:Gem::Version
88
- version: '0'
88
+ version: 0.18.5
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: pry
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -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!