beaker-pe 2.11.5 → 2.11.10

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: 6b980f0786d5843b28521338cf71f98d33798f2f59c8e5068185a419dc0d1e27
4
- data.tar.gz: c754f34e0e63b69f51ea3014091100cd68ef75112bab6952b4ea90ab02123d7c
3
+ metadata.gz: e67561d58e3d22880ebc902fd9204e74deadb4af7f35580d93c4352e6bbd08c8
4
+ data.tar.gz: 922b92e642722c8592d48925ee374d474cecda7b92f0ed4f23db6fe411e78ef9
5
5
  SHA512:
6
- metadata.gz: f02d963ffad85af682eb35300027e72b3da36dd9b306a2eb17079e9dc34941514cefe4c2776176d430b7a3f89492bcb8a847d7077990415b799b87c555b6b693
7
- data.tar.gz: 69ac13034a03600fd41932640c74e73d6d75e804b1376821d2e22e04d5b0ab4d6a0fa5f3fce272b39166b07d5b9ba63819c675d0f522bcabc5a49a98824d14ce
6
+ metadata.gz: 40180fdc182048b2bac7632c8d2236f70f2c6ff4a5256d6b42e3b0281823ed0bc1c2b03907f677471fb9483d022cec9b3fe8e513131e7313e9c2b37e78c5baa0
7
+ data.tar.gz: ac839faf008edf53c4ec75e1c27a61fa1e6fab8ae9902cb584058d35eae6f95bc3a9814b5c32ee7a82c6169d1d1cbe3aaf1f3c2d95cf8bcfdd01e6e0dc842a61
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
data/README.md CHANGED
@@ -70,10 +70,10 @@ you'd like to provide your own hosts file, set the `CONFIG` environment variable
70
70
  # Release
71
71
 
72
72
  To release new versions, we use a
73
- [Jenkins job](https://cinext-jenkinsmaster-sre-prod-1.delivery.puppetlabs.net/job/qe_beaker-pe-gem_init-multijob_master/)
73
+ [Jenkins job](https://cinext-jenkinsmaster-sre-prod-1.delivery.puppetlabs.net/job/qe_beaker-pe-gem_init-multijob_main/)
74
74
  (access to internal infrastructure will be required to view job).
75
75
 
76
- To release a new version (from the master branch), you'll need to just provide
76
+ To release a new version (from the main branch), you'll need to just provide
77
77
  a new beaker-pe version number to the job, and you're off to the races.
78
78
 
79
79
  # Questions
@@ -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
@@ -185,6 +184,12 @@ module Beaker
185
184
  pe_debug = host[:pe_debug] || opts[:pe_debug] ? ' -x' : ''
186
185
  use_puppet_ca_cert = host[:use_puppet_ca_cert] || opts[:use_puppet_ca_cert]
187
186
 
187
+ # PE 2019.8.3 had a bug in the frictionless install of osx-10.14 and osx-10.15
188
+ # We need to do a bit of a hacky process to install the agent
189
+ if host['platform'] =~ /osx-10\.1(4|5)/ && (pe_version.eql?('2019.8.3') || pe_version.eql?('2019.8.4'))
190
+ return "curl -kO https://#{downloadhost}:8140/packages/current/#{host['platform']}.bash && bash #{host['platform']}.bash"
191
+ end
192
+
188
193
  if host['platform'] =~ /windows/ then
189
194
  if use_puppet_ca_cert
190
195
  frictionless_install_opts << '-UsePuppetCA'
@@ -582,6 +587,8 @@ module Beaker
582
587
  do_install_pe_with_pe_managed_external_postgres(hosts,opts)
583
588
  when :simple_monolithic
584
589
  simple_monolithic_install(hosts.first, hosts.drop(1), opts)
590
+ when :simple_monolithic_install_with_preload
591
+ simple_monolithic_install_with_preload(hosts.first, hosts.drop(1), opts)
585
592
  when :simple_split
586
593
  # This isn't implemented yet, so just do a generic install instead
587
594
  #simple_split_install(hosts, opts)
@@ -628,7 +635,11 @@ module Beaker
628
635
 
629
636
  mono_roles = ['master', 'database', 'dashboard']
630
637
  if has_all_roles?(hosts.first, mono_roles) && hosts.drop(1).all? {|host| host['roles'].include?('frictionless')}
631
- :simple_monolithic
638
+ if hosts.first['template'] =~ /-preload/ && opts[:type] != :upgrade
639
+ :simple_monolithic_install_with_preload
640
+ else
641
+ :simple_monolithic
642
+ end
632
643
  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
644
  :simple_split
634
645
  elsif hosts.any? {|host| host['roles'].include?('pe_postgres')}
@@ -661,7 +672,7 @@ module Beaker
661
672
  register_feature_flags!(opts)
662
673
  generate_installer_conf_file_for(master, all_hosts, opts)
663
674
  step "Install PE on master" do
664
- on master, installer_cmd(master, opts) if master['template'] !~ /-preload/
675
+ on master, installer_cmd(master, opts)
665
676
  end
666
677
 
667
678
  step "Stop agent on master" do
@@ -683,18 +694,53 @@ module Beaker
683
694
  end
684
695
  end
685
696
 
697
+ # 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.
698
+ # @param [Host] master The node to configure the master on
699
+ # @param [Array<Host>] agents The nodes to install agents on
700
+ # @param [Hash{Symbol=>Symbol, String}] opts The options for how to install or upgrade PE
701
+ #
702
+ # @example
703
+ # simple_monolithic_install_with_preload(master, agents, {:type => :install, :pe_ver => '2017.2.0'})
704
+ #
705
+ # @return nil
706
+ #
707
+ # @api private
708
+ def simple_monolithic_install_with_preload(master, agents, opts={})
709
+ step "Performing a standard monolithic install with frictionless agents on a preloaded image"
710
+ all_hosts = [master, *agents]
711
+ configure_type_defaults_on([master])
712
+
713
+ # Set PE distribution on the agents, creates working directories
714
+ prepare_hosts(all_hosts, opts)
715
+ register_feature_flags!(opts)
716
+ generate_installer_conf_file_for(master, all_hosts, opts)
717
+
718
+ step "Stop agent on master" do
719
+ stop_agent_on(master)
720
+ end
721
+
722
+ if manage_puppet_service?(master[:pe_ver], options)
723
+ configure_puppet_agent_service(:ensure => 'stopped', :enabled => false)
724
+ end
725
+
726
+ install_agents_only_on(agents, opts)
727
+ end
686
728
 
687
729
  # Configure the master to use a proxy and drop unproxied connections
688
730
  def config_hosts_for_proxy_access hosts
689
731
  hosts.each do |host|
690
732
  step "Configuring #{host} to use proxy" do
691
733
  @osmirror_host = "osmirror.delivery.puppetlabs.net"
734
+ puts "Grabbing IP for osmirror.delivery.puppetlabs.net"
692
735
  @osmirror_host_ip = IPSocket.getaddress(@osmirror_host)
693
736
  @delivery_host = "artifactory.delivery.puppetlabs.net"
737
+ puts "Grabbing IP for artifactory.delivery.puppetlabs.net"
694
738
  @delivery_host_ip = IPSocket.getaddress(@delivery_host)
695
739
  @test_forge_host = "api-forge-aio02-petest.puppet.com"
740
+ puts "Grabbing IP for api-forge-aio02-petest.puppet.com"
696
741
  @test_forge_host_ip = IPSocket.getaddress(@test_forge_host)
697
742
  @github_host = "github.com"
743
+ puts "Grabbing IP for github.com"
698
744
  @github_host_ip = IPSocket.getaddress(@github_host)
699
745
  @proxy_ip = @options[:proxy_ip]
700
746
  @proxy_hostname = @options[:proxy_hostname]
@@ -1011,7 +1057,11 @@ module Beaker
1011
1057
  facts_result = on(master, 'puppet facts')
1012
1058
  raise ArgumentError, fail_message if facts_result.exit_code != 0
1013
1059
  facts_hash = JSON.parse(facts_result.stdout.chomp)
1014
- puppet_agent_version = facts_hash['values']['aio_agent_version']
1060
+ # In Puppet 7, facts are at the top level of the hash. Before that
1061
+ # version, they were wrapped inside a `values` key. Since we're
1062
+ # trying to determine the agent version here, we can't just switch
1063
+ # our behavior by agent version, so we check both possible locations.
1064
+ puppet_agent_version = facts_hash['aio_agent_version'] || facts_hash.dig('values', 'aio_agent_version')
1015
1065
  raise ArgumentError, fail_message if puppet_agent_version.nil?
1016
1066
  logger.warn("#{log_prefix} Read puppet-agent version #{puppet_agent_version} from master")
1017
1067
  # saving so that we don't have to query the master more than once
@@ -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.5'
6
+ STRING = '2.11.10'
7
7
  end
8
8
 
9
9
  end
@@ -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.5
4
+ version: 2.11.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-15 00:00:00.000000000 Z
11
+ date: 2021-01-15 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