This repository has been archived by the owner on Feb 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit cleans up (or disables) rubocop errors in order to get a clean rubocop run.
- Loading branch information
1 parent
03827f7
commit 5759b41
Showing
104 changed files
with
1,718 additions
and
1,562 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
source ENV['GEM_SOURCE'] || 'https://artifactory.delivery.puppetlabs.net/artifactory/api/gems/rubygems/' | ||
# frozen_string_literal: true | ||
|
||
gem 'beaker', '~>4.0' | ||
gem 'beaker-benchmark', '~>0.0' | ||
gem 'beaker-pe', '~>2.0' | ||
gem 'beaker-aws' | ||
gem 'beaker-abs', '~>0.1' | ||
gem 'beaker-pe-large-environments', '~>0.3' | ||
gem 'scooter', '~>4.3' | ||
gem 'rototiller', '~>1.0' | ||
gem 'rspec', '~>3.0' | ||
gem 'master_manipulator', '~>2.1' | ||
gem 'beaker-puppet', '~>1.0' | ||
source ENV["GEM_SOURCE"] || "https://artifactory.delivery.puppetlabs.net/artifactory/api/gems/rubygems/" | ||
|
||
if File.exists? "#{__FILE__}.local" | ||
eval(File.read("#{__FILE__}.local"), binding) | ||
end | ||
gem "beaker", "~>4.0" | ||
gem "beaker-abs", "~>0.1" | ||
gem "beaker-aws" | ||
gem "beaker-benchmark", "~>0.0" | ||
gem "beaker-pe", "~>2.0" | ||
gem "beaker-pe-large-environments", "~>0.3" | ||
gem "beaker-puppet", "~>1.0" | ||
gem "master_manipulator", "~>2.1" | ||
gem "rototiller", "~>1.0" | ||
gem "rspec", "~>3.0" | ||
gem "scooter", "~>4.3" | ||
|
||
gem 'google-cloud', '~> 0.52.0' | ||
gem 'google-api-client', '~> 0.19.0' | ||
eval(File.read("#{__FILE__}.local"), binding) if File.exist? "#{__FILE__}.local" # rubocop:disable Security/Eval | ||
|
||
gem "google-api-client", "~> 0.19.0" | ||
gem "google-cloud", "~> 0.52.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
source ENV['GEM_SOURCE'] || 'https://rubygems.org' | ||
# frozen_string_literal: true | ||
|
||
gem 'beaker', '~>3.2.0' | ||
gem 'beaker-hostgenerator', '0.8.0' | ||
gem 'beaker-pe', '~>1.4' | ||
source ENV["GEM_SOURCE"] || "https://rubygems.org" | ||
|
||
gem 'scooter', '~> 3.2.0' | ||
gem "beaker", "~>3.2.0" | ||
gem "beaker-hostgenerator", "0.8.0" | ||
gem "beaker-pe", "~>1.4" | ||
|
||
if File.exists? "#{__FILE__}.local" | ||
eval(File.read("#{__FILE__}.local"), binding) | ||
end | ||
gem "scooter", "~> 3.2.0" | ||
|
||
eval(File.read("#{__FILE__}.local"), binding) if File.exist? "#{__FILE__}.local" # rubocop:disable Security/Eval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
jenkins-integration/beaker/install/foss/70_install_puppet.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
step "Upgrade nss to version that is hopefully compatible with jdk version puppetserver will use." do | ||
nss_package=nil | ||
variant, _, _, _ = master['platform'].to_array | ||
variant, = master["platform"].to_array | ||
case variant | ||
when /^(debian|ubuntu)$/ | ||
nss_package_name="libnss3" | ||
nss_package_name = "libnss3" | ||
when /^(redhat|el|centos)$/ | ||
nss_package_name="nss" | ||
nss_package_name = "nss" | ||
end | ||
if nss_package_name | ||
if defined?(nss_package_name) | ||
master.upgrade_package(nss_package_name) | ||
else | ||
Beaker::Log.warn("Don't know what nss package to use for #{variant} so not installing one") | ||
end | ||
end | ||
|
||
step "Install Puppet Server." do | ||
install_package master, 'puppetserver' | ||
install_package master, "puppetserver" | ||
end |
4 changes: 3 additions & 1 deletion
4
jenkins-integration/beaker/install/foss/80_run_agent_on_master.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 15 additions & 12 deletions
27
jenkins-integration/beaker/install/pe/60_classify_nodes_via_NC.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,40 @@ | ||
require 'puppet/gatling/config' | ||
require 'scooter' | ||
# frozen_string_literal: true | ||
|
||
require "puppet/gatling/config" | ||
require "scooter" | ||
|
||
test_name "Classify PE agents via Node Classifier" | ||
|
||
def classify_pe_nodes(classifier, nodes) | ||
production_id = classifier.get_node_group_id_by_name('Production environment') | ||
production_id = classifier.get_node_group_id_by_name("Production environment") | ||
nodes = group_by_environment(nodes) | ||
nodes.each_pair do |env, node_configs| | ||
node_configs.each do |config| | ||
classifier.find_or_create_node_group_model( | ||
'name' => "#{config['certname_prefix']}-group", | ||
'parent' => production_id, | ||
'environment' => env, | ||
'environment_trumps' => true, | ||
'rule' => ['~', ['fact', 'clientcert'], "#{config['certname_prefix']}.*"], | ||
'classes' => Hash[config['classes'].map { |klass| [klass, {}] }]) | ||
"name" => "#{config['certname_prefix']}-group", | ||
"parent" => production_id, | ||
"environment" => env, | ||
"environment_trumps" => true, | ||
"rule" => ["~", %w[fact clientcert], "#{config['certname_prefix']}.*"], | ||
"classes" => Hash[config["classes"].map { |klass| [klass, {}] }] | ||
) | ||
end | ||
end | ||
end | ||
|
||
# this code gets the list of node -> class name mappings by parsing | ||
# the g-p-l-t 'scenario' json file. | ||
|
||
nodes = node_configs(get_scenario_from_env()) | ||
nodes = node_configs(get_scenario_from_env) | ||
classifier = Scooter::HttpDispatchers::ConsoleDispatcher.new(dashboard) | ||
|
||
# Updating classes can take a VERY long time, like the OPS deployment | ||
# which has ~80 environments each with hundreds of classes. | ||
# Set the connection timeout to 60 minutes to accomodate this. | ||
classifier.connection.options.timeout = 3600 | ||
classifier.update_classes() | ||
classifier.update_classes | ||
|
||
classify_pe_nodes(classifier, nodes) | ||
|
||
# TODO validate classes by asking for the classes for the each node and | ||
# TODO: validate classes by asking for the classes for the each node and | ||
# asserting they're the same ones that are in the JSON config |
14 changes: 8 additions & 6 deletions
14
jenkins-integration/beaker/install/pe/97_enable_file_sync.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
require 'scooter' | ||
test_name 'Enable file_sync' do | ||
# frozen_string_literal: true | ||
|
||
require "scooter" | ||
test_name "Enable file_sync" do | ||
api = Scooter::HttpDispatchers::ConsoleDispatcher.new(dashboard) | ||
pe_master_group = api.get_node_group_by_name('PE Master') | ||
pe_master_group['classes']['puppet_enterprise::profile::master']['file_sync_enabled'] = true | ||
api.replace_node_group(pe_master_group['id'], pe_master_group) | ||
on(master, 'puppet agent -t', :acceptable_exit_codes => [0,2]) | ||
pe_master_group = api.get_node_group_by_name("PE Master") | ||
pe_master_group["classes"]["puppet_enterprise::profile::master"]["file_sync_enabled"] = true | ||
api.replace_node_group(pe_master_group["id"], pe_master_group) | ||
on(master, "puppet agent -t", acceptable_exit_codes: [0, 2]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
jenkins-integration/beaker/install/shared/40_clone_test_catalogs.rb
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.