beaker-pe 2.11.6 → 2.11.11

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: e607f0adbf9ab049934cd0ce8b147e60e63fe642aa2cb78cbb92db28c72dc97b
4
- data.tar.gz: 3f51752866e156e61b75d9fbca4f1d00cc916f68f7c197fd089d1cc5069649d0
3
+ metadata.gz: a601533eb75af4da03d301dbe3649a12f5123dc1ed962e9aeedd76069563bf51
4
+ data.tar.gz: 2b530fbdf6d59a6743576e4c7c4820c28d193d7dcf9cc403a5fcbe1929e21fc5
5
5
  SHA512:
6
- metadata.gz: 337a4164bcc7d6a5e73e515ee4b277a11b1a08524cda7158226303a229b962e4a65072aa2b51e968658580c8784c8f9ae25940e79c31e863c94b414a6096438a
7
- data.tar.gz: 81e2989aa75682be94555e98273ce477d71384bdaa55ccbcc3a12d42030d512b6ed3382e04e0aa1d12fc447cd5c0e23f4b7a1dd4da67a1bbdabacc15da6606e7
6
+ metadata.gz: f340e1fa5d7e7e3a495a2505ee207f4f69d2a67df84ff698bd57bf9dae0213d3b52ee7b6daa30449b5e9e0720f541029276cad4618a249b714eb548aaf587cfc
7
+ data.tar.gz: aea775bc25fc35d26ab14d471818c50acb52a6f27557c4f1fd31214568d8bee1fd4981e0ba68e6a398c965063a8698c49b3a20eaa52ffa98892c4f2c9a76e673
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]
@@ -715,6 +761,9 @@ module Beaker
715
761
  on host, "iptables -A OUTPUT -p tcp -d #{@osmirror_host_ip} -j DROP"
716
762
  on host, "iptables -A OUTPUT -p tcp -d #{@delivery_host_ip} -j DROP"
717
763
  on host, "iptables -A OUTPUT -p tcp -d #{@test_forge_host_ip} -j DROP"
764
+ # The next two lines are for our production and test k8s test runners
765
+ on host, "iptables -A OUTPUT -p tcp -d 10.236.112.0/20 -j ACCEPT"
766
+ on host, "iptables -A OUTPUT -p tcp -d 10.220.0.0/16 -j ACCEPT"
718
767
  # The next two lines clear the rest of the internal puppet lan
719
768
  on host, "iptables -A OUTPUT -p tcp -d 10.16.0.0/16 -j ACCEPT"
720
769
  on host, "iptables -A OUTPUT -p tcp -d 10.32.0.0/16 -j ACCEPT"
@@ -1011,7 +1060,11 @@ module Beaker
1011
1060
  facts_result = on(master, 'puppet facts')
1012
1061
  raise ArgumentError, fail_message if facts_result.exit_code != 0
1013
1062
  facts_hash = JSON.parse(facts_result.stdout.chomp)
1014
- puppet_agent_version = facts_hash['values']['aio_agent_version']
1063
+ # In Puppet 7, facts are at the top level of the hash. Before that
1064
+ # version, they were wrapped inside a `values` key. Since we're
1065
+ # trying to determine the agent version here, we can't just switch
1066
+ # our behavior by agent version, so we check both possible locations.
1067
+ puppet_agent_version = facts_hash['aio_agent_version'] || facts_hash.dig('values', 'aio_agent_version')
1015
1068
  raise ArgumentError, fail_message if puppet_agent_version.nil?
1016
1069
  logger.warn("#{log_prefix} Read puppet-agent version #{puppet_agent_version} from master")
1017
1070
  # saving so that we don't have to query the master more than once
@@ -3,7 +3,7 @@ module Beaker
3
3
  module PE
4
4
 
5
5
  module Version
6
- STRING = '2.11.6'
6
+ STRING = '2.11.11'
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.6
4
+ version: 2.11.11
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-22 00:00:00.000000000 Z
11
+ date: 2021-01-25 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