r10k 3.14.1 → 5.0.1
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 +4 -4
- data/.github/dependabot.yml +17 -0
- data/.github/workflows/docker.yml +9 -4
- data/.github/workflows/release.yml +3 -2
- data/.github/workflows/rspec_tests.yml +8 -10
- data/CHANGELOG.mkd +100 -0
- data/CODEOWNERS +1 -2
- data/Gemfile +2 -2
- data/README.mkd +18 -19
- data/doc/common-patterns.mkd +1 -2
- data/doc/dynamic-environments/configuration.mkd +91 -12
- data/doc/dynamic-environments/usage.mkd +4 -0
- data/doc/dynamic-environments/workflow-guide.mkd +3 -3
- data/doc/faq.mkd +1 -1
- data/doc/puppetfile.mkd +9 -3
- data/integration/Gemfile +3 -4
- data/integration/Rakefile +58 -23
- data/integration/files/pre-suite/git_config.pp.erb +1 -1
- data/integration/pre-suite/00_pe_install.rb +3 -0
- data/integration/pre-suite/10_git_config.rb +1 -3
- data/integration/tests/Puppetfile/HTTP_PROXY_affects_git_source.rb +5 -4
- data/integration/tests/basic_functionality/negative/negative_bad_proxy.rb +1 -1
- data/integration/tests/basic_functionality/proxy_specified_in_configuration.rb +2 -2
- data/integration/tests/basic_functionality/proxy_with_puppetfile.rb +2 -2
- data/integration/tests/basic_functionality/rugged_git_provider_with_ssh.rb +3 -3
- data/integration/tests/basic_functionality/rugged_git_provider_without_ssh.rb +3 -3
- data/integration/tests/command_line/deploy_env_without_mod_update.rb +0 -3
- data/integration/tests/command_line/negative/neg_deploy_env_with_module_update.rb +0 -3
- data/integration/tests/git_source/HTTP_proxy_and_git_source.rb +5 -10
- data/integration/tests/git_source/git_source_git.rb +1 -4
- data/integration/tests/git_source/git_source_repeated_remote.rb +2 -5
- data/integration/tests/git_source/git_source_submodule.rb +1 -1
- data/integration/tests/git_source/negative/neg_git_unauthorized_ssh.rb +1 -1
- data/integration/tests/purging/content_not_purged_at_root.rb +2 -5
- data/integration/tests/purging/default_purging.rb +0 -3
- data/integration/tests/purging/{does_not_purge_files_on_white_list.rb → does_not_purge_files_on_allowlist.rb} +2 -5
- data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb +1 -4
- data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb +1 -4
- data/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb +1 -4
- data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_forge_module.rb +0 -3
- data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_module.rb +1 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_module_ref.rb +1 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_disk_full.rb +1 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb +0 -3
- data/integration/tests/user_scenario/basic_workflow/negative/neg_inaccessible_forge.rb +3 -2
- data/integration/tests/user_scenario/basic_workflow/negative/neg_specify_deleted_forge_module.rb +1 -5
- data/integration/tests/user_scenario/basic_workflow/single_env_10000_files.rb +1 -1
- data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb +1 -4
- data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_module.rb +0 -3
- data/integration/tests/user_scenario/basic_workflow/single_env_large_files.rb +1 -1
- data/integration/tests/user_scenario/basic_workflow/single_env_module_already_installed.rb +0 -3
- data/integration/tests/user_scenario/basic_workflow/single_env_purge_unmanaged_modules.rb +0 -3
- data/integration/tests/user_scenario/basic_workflow/single_env_switch_forge_git_module.rb +1 -4
- data/integration/tests/user_scenario/basic_workflow/single_env_upgrade_forge_mod_revert_change.rb +0 -3
- data/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb +0 -3
- data/lib/r10k/action/deploy/environment.rb +2 -19
- data/lib/r10k/action/deploy/module.rb +1 -0
- data/lib/r10k/action/puppetfile/check.rb +7 -0
- data/lib/r10k/action/puppetfile/install.rb +3 -1
- data/lib/r10k/cli/deploy.rb +15 -1
- data/lib/r10k/cli/puppetfile.rb +1 -0
- data/lib/r10k/content_synchronizer.rb +7 -2
- data/lib/r10k/environment/with_modules.rb +24 -1
- data/lib/r10k/environment.rb +0 -1
- data/lib/r10k/git/rugged/bare_repository.rb +5 -4
- data/lib/r10k/git/rugged/thin_repository.rb +7 -0
- data/lib/r10k/git/rugged/working_repository.rb +13 -7
- data/lib/r10k/git/shellgit/thin_repository.rb +5 -1
- data/lib/r10k/git/shellgit/working_repository.rb +5 -4
- data/lib/r10k/git/stateful_repository.rb +4 -4
- data/lib/r10k/module/base.rb +3 -3
- data/lib/r10k/module/git.rb +19 -5
- data/lib/r10k/module_loader/puppetfile/dsl.rb +4 -0
- data/lib/r10k/module_loader/puppetfile.rb +22 -14
- data/lib/r10k/puppetfile.rb +1 -1
- data/lib/r10k/settings/container.rb +1 -0
- data/lib/r10k/settings.rb +6 -7
- data/lib/r10k/tarball.rb +1 -1
- data/lib/r10k/version.rb +1 -1
- data/locales/r10k.pot +34 -82
- data/r10k.gemspec +8 -18
- metadata +40 -213
- data/.github/workflows/stale.yml +0 -21
- data/.travis.yml +0 -42
- data/docker/.gitignore +0 -1
- data/docker/.rspec +0 -4
- data/docker/Gemfile +0 -11
- data/docker/Makefile +0 -92
- data/docker/README.md +0 -28
- data/docker/docker-compose.yml +0 -18
- data/docker/r10k/Dockerfile +0 -68
- data/docker/r10k/adduser.sh +0 -13
- data/docker/r10k/docker-entrypoint.d/10-analytics.sh +0 -30
- data/docker/r10k/docker-entrypoint.sh +0 -10
- data/docker/r10k/release.Dockerfile +0 -55
- data/docker/spec/dockerfile_spec.rb +0 -37
- data/docker/spec/fixtures/Puppetfile +0 -2
- data/integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb +0 -83
- data/integration/tests/basic_functionality/proxy_with_pe_only_module.rb +0 -128
- data/integration/tests/purging/invalid_whitelist_types.rb +0 -63
- data/integration/tests/user_scenario/basic_workflow/negative/neg_module_specified_at_deleted_release.rb +0 -49
- data/integration/tests/user_scenario/basic_workflow/single_env_module_last_release_deleted.rb +0 -68
- data/lib/r10k/environment/bare.rb +0 -13
- data/spec/fixtures/empty/.empty +0 -0
- data/spec/fixtures/integration/git/puppet-boolean-bare.tar +0 -0
- data/spec/fixtures/module/forge/bad_module/metadata.json +0 -1
- data/spec/fixtures/module/forge/eight_hundred/Modulefile +0 -8
- data/spec/fixtures/module/forge/eight_hundred/metadata.json +0 -19
- data/spec/fixtures/tarball/tarball.tar.gz +0 -0
- data/spec/fixtures/unit/action/r10k.yaml +0 -5
- data/spec/fixtures/unit/action/r10k_cachedir.yaml +0 -2
- data/spec/fixtures/unit/action/r10k_creds.yaml +0 -9
- data/spec/fixtures/unit/action/r10k_forge_auth.yaml +0 -4
- data/spec/fixtures/unit/action/r10k_forge_auth_no_url.yaml +0 -3
- data/spec/fixtures/unit/action/r10k_generate_types.yaml +0 -3
- data/spec/fixtures/unit/action/r10k_logging.yaml +0 -12
- data/spec/fixtures/unit/action/r10k_puppet_path.yaml +0 -3
- data/spec/fixtures/unit/puppetfile/argument-error/Puppetfile +0 -1
- data/spec/fixtures/unit/puppetfile/default-branch-override/Puppetfile +0 -5
- data/spec/fixtures/unit/puppetfile/duplicate-module-error/Puppetfile +0 -10
- data/spec/fixtures/unit/puppetfile/forge-override/Puppetfile +0 -8
- data/spec/fixtures/unit/puppetfile/invalid-syntax/Puppetfile +0 -1
- data/spec/fixtures/unit/puppetfile/load-error/Puppetfile +0 -1
- data/spec/fixtures/unit/puppetfile/name-error/Puppetfile +0 -1
- data/spec/fixtures/unit/puppetfile/valid-forge-with-version/Puppetfile +0 -1
- data/spec/fixtures/unit/puppetfile/valid-forge-without-version/Puppetfile +0 -1
- data/spec/fixtures/unit/puppetfile/various-modules/Puppetfile +0 -10
- data/spec/fixtures/unit/puppetfile/various-modules/Puppetfile.new +0 -10
- data/spec/fixtures/unit/util/purgeable/managed_one/expected_1 +0 -0
- data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/managed_symlink_file +0 -1
- data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/subdir_allowlisted_2/ignored_1 +0 -0
- data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/subdir_expected_1 +0 -0
- data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/subdir_unmanaged_1 +0 -0
- data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/unmanaged_symlink_dir +0 -1
- data/spec/fixtures/unit/util/purgeable/managed_one/managed_symlink_dir +0 -1
- data/spec/fixtures/unit/util/purgeable/managed_one/unmanaged_1 +0 -0
- data/spec/fixtures/unit/util/purgeable/managed_one/unmanaged_symlink_file +0 -1
- data/spec/fixtures/unit/util/purgeable/managed_two/.hidden/unmanaged_3 +0 -0
- data/spec/fixtures/unit/util/purgeable/managed_two/expected_2 +0 -0
- data/spec/fixtures/unit/util/purgeable/managed_two/unmanaged_2 +0 -0
- data/spec/fixtures/unit/util/subprocess/runner/no-execute.sh +0 -3
- data/spec/integration/git/rugged/bare_repository_spec.rb +0 -13
- data/spec/integration/git/rugged/cache_spec.rb +0 -33
- data/spec/integration/git/rugged/thin_repository_spec.rb +0 -14
- data/spec/integration/git/rugged/working_repository_spec.rb +0 -48
- data/spec/integration/git/shellgit/bare_repository_spec.rb +0 -13
- data/spec/integration/git/shellgit/thin_repository_spec.rb +0 -14
- data/spec/integration/git/shellgit/working_repository_spec.rb +0 -13
- data/spec/integration/git/stateful_repository_spec.rb +0 -159
- data/spec/integration/util/purageable_spec.rb +0 -41
- data/spec/matchers/exit_with.rb +0 -28
- data/spec/matchers/match_realpath.rb +0 -18
- data/spec/r10k-mocks/mock_config.rb +0 -33
- data/spec/r10k-mocks/mock_env.rb +0 -18
- data/spec/r10k-mocks/mock_source.rb +0 -17
- data/spec/r10k-mocks.rb +0 -3
- data/spec/shared-contexts/git-fixtures.rb +0 -55
- data/spec/shared-contexts/tarball.rb +0 -32
- data/spec/shared-examples/deploy-actions.rb +0 -69
- data/spec/shared-examples/git/bare_repository.rb +0 -132
- data/spec/shared-examples/git/thin_repository.rb +0 -26
- data/spec/shared-examples/git/working_repository.rb +0 -207
- data/spec/shared-examples/git-repository.rb +0 -38
- data/spec/shared-examples/puppetfile-action.rb +0 -39
- data/spec/shared-examples/settings/ancestry.rb +0 -44
- data/spec/shared-examples/subprocess-runner.rb +0 -89
- data/spec/spec_helper.rb +0 -41
- data/spec/unit/action/cri_runner_spec.rb +0 -72
- data/spec/unit/action/deploy/deploy_helpers_spec.rb +0 -38
- data/spec/unit/action/deploy/display_spec.rb +0 -61
- data/spec/unit/action/deploy/environment_spec.rb +0 -640
- data/spec/unit/action/deploy/module_spec.rb +0 -476
- data/spec/unit/action/puppetfile/check_spec.rb +0 -53
- data/spec/unit/action/puppetfile/cri_runner_spec.rb +0 -47
- data/spec/unit/action/puppetfile/install_spec.rb +0 -112
- data/spec/unit/action/puppetfile/purge_spec.rb +0 -60
- data/spec/unit/action/runner_spec.rb +0 -407
- data/spec/unit/action/visitor_spec.rb +0 -39
- data/spec/unit/cli_spec.rb +0 -9
- data/spec/unit/deployment/config_spec.rb +0 -33
- data/spec/unit/deployment_spec.rb +0 -162
- data/spec/unit/environment/bare_spec.rb +0 -13
- data/spec/unit/environment/base_spec.rb +0 -122
- data/spec/unit/environment/git_spec.rb +0 -114
- data/spec/unit/environment/name_spec.rb +0 -181
- data/spec/unit/environment/plain_spec.rb +0 -8
- data/spec/unit/environment/svn_spec.rb +0 -146
- data/spec/unit/environment/tarball_spec.rb +0 -45
- data/spec/unit/environment/with_modules_spec.rb +0 -75
- data/spec/unit/errors/formatting_spec.rb +0 -84
- data/spec/unit/feature_spec.rb +0 -50
- data/spec/unit/forge/module_release_spec.rb +0 -213
- data/spec/unit/git/alternates_spec.rb +0 -116
- data/spec/unit/git/cache_spec.rb +0 -66
- data/spec/unit/git/rugged/cache_spec.rb +0 -48
- data/spec/unit/git/rugged/credentials_spec.rb +0 -215
- data/spec/unit/git/shellgit/cache_spec.rb +0 -27
- data/spec/unit/git/stateful_repository_spec.rb +0 -45
- data/spec/unit/git_spec.rb +0 -102
- data/spec/unit/initializers_spec.rb +0 -68
- data/spec/unit/instance_cache_spec.rb +0 -78
- data/spec/unit/keyed_factory_spec.rb +0 -51
- data/spec/unit/logging/terminaloutputter_spec.rb +0 -53
- data/spec/unit/logging_spec.rb +0 -68
- data/spec/unit/module/base_spec.rb +0 -118
- data/spec/unit/module/forge_spec.rb +0 -271
- data/spec/unit/module/git_spec.rb +0 -387
- data/spec/unit/module/metadata_file_spec.rb +0 -68
- data/spec/unit/module/svn_spec.rb +0 -208
- data/spec/unit/module/tarball_spec.rb +0 -70
- data/spec/unit/module_loader/puppetfile_spec.rb +0 -421
- data/spec/unit/module_spec.rb +0 -114
- data/spec/unit/puppetfile_spec.rb +0 -304
- data/spec/unit/settings/collection_spec.rb +0 -123
- data/spec/unit/settings/container_spec.rb +0 -92
- data/spec/unit/settings/definition_spec.rb +0 -79
- data/spec/unit/settings/enum_definition_spec.rb +0 -20
- data/spec/unit/settings/inheritance_spec.rb +0 -38
- data/spec/unit/settings/list_spec.rb +0 -88
- data/spec/unit/settings/loader_spec.rb +0 -110
- data/spec/unit/settings/uri_definition_spec.rb +0 -23
- data/spec/unit/settings_spec.rb +0 -303
- data/spec/unit/source/base_spec.rb +0 -31
- data/spec/unit/source/exec_spec.rb +0 -81
- data/spec/unit/source/git_spec.rb +0 -233
- data/spec/unit/source/hash_spec.rb +0 -54
- data/spec/unit/source/svn_spec.rb +0 -196
- data/spec/unit/source/yaml_spec.rb +0 -42
- data/spec/unit/source_spec.rb +0 -10
- data/spec/unit/svn/remote_spec.rb +0 -21
- data/spec/unit/svn/working_dir_spec.rb +0 -56
- data/spec/unit/tarball_spec.rb +0 -57
- data/spec/unit/util/attempt_spec.rb +0 -82
- data/spec/unit/util/cacheable_spec.rb +0 -23
- data/spec/unit/util/commands_spec.rb +0 -61
- data/spec/unit/util/downloader_spec.rb +0 -98
- data/spec/unit/util/exec_env_spec.rb +0 -56
- data/spec/unit/util/purgeable_spec.rb +0 -267
- data/spec/unit/util/setopts_spec.rb +0 -83
- data/spec/unit/util/subprocess/result_spec.rb +0 -36
- data/spec/unit/util/subprocess/runner/posix_spec.rb +0 -7
- data/spec/unit/util/subprocess/runner/pump_spec.rb +0 -79
- data/spec/unit/util/subprocess/runner/windows_spec.rb +0 -7
- data/spec/unit/util/subprocess/subprocess_error_spec.rb +0 -26
- data/spec/unit/util/subprocess_spec.rb +0 -65
- data/spec/unit/util/symbolize_keys_spec.rb +0 -67
data/integration/Rakefile
CHANGED
@@ -20,24 +20,6 @@ end
|
|
20
20
|
desc 'The acceptance tests for r10k, run in the beaker framework'
|
21
21
|
rototiller_task :beaker => [:beaker_hostgenerator] do |t|
|
22
22
|
|
23
|
-
common_setup = <<-EOS
|
24
|
-
pre-suite/00_pe_install.rb,
|
25
|
-
component/pre-suite/05_install_dev_r10k.rb,
|
26
|
-
pre-suite/10_git_config.rb,
|
27
|
-
pre-suite/20_pe_r10k.rb,
|
28
|
-
EOS
|
29
|
-
common_setup.gsub!("\n", '')
|
30
|
-
|
31
|
-
flags = [
|
32
|
-
{:name => '--hosts', :default => 'configs/generated', :override_env => 'BEAKER_HOST'},
|
33
|
-
{:name => '--keyfile', :default => "#{ENV['HOME']}/.ssh/id_rsa-acceptance", :override_env => 'BEAKER_KEYFILE'},
|
34
|
-
{:name => '--load-path', :default => 'lib'},
|
35
|
-
{:name => '--pre-suite', :default => @acceptance_pre_suite || common_setup, :override_env => 'BEAKER_PRE_SUITE'},
|
36
|
-
{:name => '--tests', :default => 'tests', :override_env => 'BEAKER_TESTS'},
|
37
|
-
{:name => '--preserve-hosts', :default => 'onfail', :override_env => 'BEAKER_PRESERVE_HOSTS'},
|
38
|
-
]
|
39
|
-
t.add_flag(*flags)
|
40
|
-
|
41
23
|
t.add_env do |env|
|
42
24
|
env.name = 'PE_FAMILY'
|
43
25
|
env.message = 'The puppet enterprise major branch to install from'
|
@@ -54,7 +36,62 @@ EOS
|
|
54
36
|
env.message = 'The git provider that r10k should use on a SUT'
|
55
37
|
end
|
56
38
|
|
57
|
-
t.add_command
|
39
|
+
t.add_command do |cmd|
|
40
|
+
cmd.name = 'beaker --debug'
|
41
|
+
|
42
|
+
common_setup = <<-EOS
|
43
|
+
pre-suite/00_pe_install.rb,
|
44
|
+
component/pre-suite/05_install_dev_r10k.rb,
|
45
|
+
pre-suite/10_git_config.rb,
|
46
|
+
pre-suite/20_pe_r10k.rb,
|
47
|
+
EOS
|
48
|
+
common_setup.gsub!("\n", '')
|
49
|
+
|
50
|
+
cmd.add_option do |opt|
|
51
|
+
opt.name = '--hosts'
|
52
|
+
opt.add_argument do |arg|
|
53
|
+
arg.name = 'configs/generated'
|
54
|
+
arg.add_env({name: 'BEAKER_HOST'})
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
cmd.add_option do |opt|
|
59
|
+
opt.name = '--keyfile'
|
60
|
+
opt.add_argument do |arg|
|
61
|
+
arg.name = "#{ENV['HOME']}/.ssh/id_rsa-acceptance"
|
62
|
+
arg.add_env({name: 'BEAKER_KEYFILE'})
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
cmd.add_option do |opt|
|
67
|
+
opt.name = '--pre-suite'
|
68
|
+
opt.add_argument do |arg|
|
69
|
+
arg.name = @acceptance_pre_suite || common_setup
|
70
|
+
arg.add_env({name: 'BEAKER_PRE_SUITE'})
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
cmd.add_option do |opt|
|
75
|
+
opt.name = '--tests'
|
76
|
+
opt.add_argument do |arg|
|
77
|
+
arg.name = 'tests'
|
78
|
+
arg.add_env({name: 'BEAKER_TESTS'})
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
cmd.add_option do |opt|
|
83
|
+
opt.name = '--preserve-hosts'
|
84
|
+
opt.add_argument do |arg|
|
85
|
+
arg.name = 'onfail'
|
86
|
+
arg.add_env({name: 'BEAKER_PRESERVE_HOSTS'})
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
cmd.add_option do |opt|
|
91
|
+
opt.name = '--load-path'
|
92
|
+
opt.add_argument({name: 'lib'})
|
93
|
+
end
|
94
|
+
end
|
58
95
|
end
|
59
96
|
|
60
97
|
desc 'Generate a host configuration used by Beaker'
|
@@ -64,12 +101,10 @@ rototiller_task :beaker_hostgenerator do |t|
|
|
64
101
|
t.add_command do |c|
|
65
102
|
c.name = 'beaker-hostgenerator'
|
66
103
|
c.argument = '> configs/generated'
|
104
|
+
c.add_option(:name => '', :default => 'centos7-64mdca-64.fa', :override_env => 'TEST_TARGET')
|
105
|
+
c.add_option(:name => '--global-config', :default => '{forge_host=forgeapi.puppet.com}', :override_env => 'BHG_GLOBAL_CONFIG')
|
67
106
|
end
|
68
107
|
|
69
|
-
# This is a hack :(
|
70
|
-
t.add_flag(:name => '', :default => 'centos7-64mdca-64.fa', :override_env => 'TEST_TARGET')
|
71
|
-
|
72
|
-
t.add_flag(:name => '--global-config', :default => '{forge_host=forge-aio01-petest.puppetlabs.com}', :override_env => 'BHG_GLOBAL_CONFIG')
|
73
108
|
end
|
74
109
|
end
|
75
110
|
|
@@ -23,9 +23,6 @@ pe_version = get_puppet_version(master)
|
|
23
23
|
fail_test('This pre-suite requires PE 3.7 or above!') if pe_version < 3.7
|
24
24
|
|
25
25
|
#Setup
|
26
|
-
step 'Stub Forge on Master'
|
27
|
-
stub_forge_on(master)
|
28
|
-
|
29
26
|
step 'Read module path'
|
30
27
|
on(master, puppet('config print basemodulepath')) do |result|
|
31
28
|
(result.stdout.include? ':') ? separator = ':' : separator = ';'
|
@@ -39,6 +36,7 @@ step 'Install and Configure Git'
|
|
39
36
|
on(master, puppet('apply'), :stdin => git_manifest, :acceptable_exit_codes => [0,2]) do |result|
|
40
37
|
assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!')
|
41
38
|
end
|
39
|
+
on(master, 'git config --system --add safe.directory "*"')
|
42
40
|
|
43
41
|
step 'Create "production" Environment on Git'
|
44
42
|
init_r10k_source_from_prod(master, git_repo_path, git_repo_name, git_environments_path, 'production')
|
@@ -19,7 +19,7 @@ r10k_config_bak_path = "#{r10k_config_path}.bak"
|
|
19
19
|
|
20
20
|
puppetfile =<<-EOS
|
21
21
|
mod 'motd',
|
22
|
-
:git => 'https://github.com/puppetlabs/puppetlabs-motd'
|
22
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-motd', :branch => 'main'
|
23
23
|
EOS
|
24
24
|
|
25
25
|
proxy_env_value = 'http://ferritsarebest.net:3219'
|
@@ -36,7 +36,7 @@ sources:
|
|
36
36
|
CONF
|
37
37
|
|
38
38
|
teardown do
|
39
|
-
master.clear_env_var('
|
39
|
+
master.clear_env_var('HTTPS_PROXY')
|
40
40
|
|
41
41
|
step 'Restore Original "r10k" Config'
|
42
42
|
on(master, "mv #{r10k_config_bak_path} #{r10k_config_path}")
|
@@ -45,7 +45,7 @@ teardown do
|
|
45
45
|
clean_up_r10k(master, last_commit, git_environments_path)
|
46
46
|
end
|
47
47
|
|
48
|
-
master.add_env_var('
|
48
|
+
master.add_env_var('HTTPS_PROXY', proxy_env_value)
|
49
49
|
|
50
50
|
step 'Backup Current "r10k" Config'
|
51
51
|
on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
|
@@ -64,7 +64,8 @@ git_add_commit_push(master, 'production', 'add Puppetfile', git_environments_pat
|
|
64
64
|
|
65
65
|
#test
|
66
66
|
on(master, "#{r10k_fqp} deploy environment -p", :accept_all_exit_codes => true) do |r|
|
67
|
-
|
67
|
+
# Rugged as of 0.28 has a different error message than shellgit
|
68
|
+
regex = /((failed to resolve address for)|(Could not resolve proxy:)) ferritsarebest\.net/
|
68
69
|
assert(r.exit_code == 1, 'expected error code was not observed')
|
69
70
|
assert_match(regex, r.stderr, 'The expected error message was not observed' )
|
70
71
|
end
|
@@ -6,7 +6,7 @@ test_name 'RK-110 - C87652 - Specify the proxy in the r10k.yaml'
|
|
6
6
|
confine(:to, :platform => ['el', 'sles'])
|
7
7
|
|
8
8
|
#Init
|
9
|
-
master_platform = fact_on(master, '
|
9
|
+
master_platform = fact_on(master, 'os.family')
|
10
10
|
env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
|
11
11
|
r10k_fqp = get_r10k_fqp(master)
|
12
12
|
|
@@ -50,7 +50,7 @@ forge:
|
|
50
50
|
CONF
|
51
51
|
|
52
52
|
#Verification
|
53
|
-
squid_log_regex = /CONNECT forgeapi.
|
53
|
+
squid_log_regex = /CONNECT forgeapi.puppet(labs)?.com:443/
|
54
54
|
|
55
55
|
#Teardown
|
56
56
|
teardown do
|
@@ -6,7 +6,7 @@ test_name 'RK-110 - C87651 - Specify a proxy in an environment variable'
|
|
6
6
|
confine(:to, :platform => ['el', 'sles'])
|
7
7
|
|
8
8
|
#Init
|
9
|
-
master_platform = fact_on(master, '
|
9
|
+
master_platform = fact_on(master, 'os.family')
|
10
10
|
r10k_fqp = get_r10k_fqp(master)
|
11
11
|
|
12
12
|
case master_platform
|
@@ -21,7 +21,7 @@ remove_squid = "#{pkg_manager} remove -y squid"
|
|
21
21
|
squid_log = "/var/log/squid/access.log"
|
22
22
|
|
23
23
|
#Verification
|
24
|
-
squid_log_regex = /CONNECT forgeapi.
|
24
|
+
squid_log_regex = /CONNECT forgeapi.puppet(labs)?.com:443/
|
25
25
|
|
26
26
|
#Teardown
|
27
27
|
teardown do
|
@@ -10,12 +10,12 @@ confine(:to, :platform => ['el', 'ubuntu', 'sles'])
|
|
10
10
|
|
11
11
|
if ENV['GIT_PROVIDER'] == 'shellgit'
|
12
12
|
skip_test('Skipping test because removing Git from the system affects other "shellgit" tests.')
|
13
|
-
elsif fact_on(master, '
|
13
|
+
elsif fact_on(master, 'os.family') == 'RedHat' and fact_on(master, "os.release.major").to_i < 6
|
14
14
|
skip_test('This version of EL is not supported by this test case!')
|
15
15
|
end
|
16
16
|
|
17
17
|
#Init
|
18
|
-
master_platform = fact_on(master, '
|
18
|
+
master_platform = fact_on(master, 'os.family')
|
19
19
|
master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
|
20
20
|
env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
|
21
21
|
r10k_fqp = get_r10k_fqp(master)
|
@@ -87,7 +87,7 @@ step 'Remove "git" Package from System'
|
|
87
87
|
if master_platform == 'RedHat'
|
88
88
|
on(master, 'yum remove -y git')
|
89
89
|
elsif master_platform == 'Debian'
|
90
|
-
if fact_on(master, "
|
90
|
+
if fact_on(master, "os.release.major") == '10.04'
|
91
91
|
on(master, 'apt-get remove -y git-core')
|
92
92
|
else
|
93
93
|
on(master, 'apt-get remove -y git')
|
@@ -8,12 +8,12 @@ confine(:to, :platform => ['el', 'ubuntu', 'sles'])
|
|
8
8
|
|
9
9
|
if ENV['GIT_PROVIDER'] == 'shellgit'
|
10
10
|
skip_test('Skipping test because removing Git from the system affects other "shellgit" tests.')
|
11
|
-
elsif fact_on(master, '
|
11
|
+
elsif fact_on(master, 'os.family') == 'RedHat' and fact_on(master, "os.release.major").to_i < 6
|
12
12
|
skip_test('This version of EL is not supported by this test case!')
|
13
13
|
end
|
14
14
|
|
15
15
|
#Init
|
16
|
-
master_platform = fact_on(master, '
|
16
|
+
master_platform = fact_on(master, 'os.family')
|
17
17
|
master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
|
18
18
|
env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
|
19
19
|
r10k_fqp = get_r10k_fqp(master)
|
@@ -86,7 +86,7 @@ step 'Remove "git" Package from System'
|
|
86
86
|
if master_platform == 'RedHat'
|
87
87
|
on(master, 'yum remove -y git')
|
88
88
|
elsif master_platform == 'Debian'
|
89
|
-
if fact_on(master, "
|
89
|
+
if fact_on(master, "os.release.major") == '10.04'
|
90
90
|
on(master, 'apt-get remove -y git-core')
|
91
91
|
else
|
92
92
|
on(master, 'apt-get remove -y git')
|
@@ -16,28 +16,24 @@ r10k_config_bak_path = "#{r10k_config_path}.bak"
|
|
16
16
|
|
17
17
|
puppetfile =<<-EOS
|
18
18
|
mod 'motd',
|
19
|
-
:git
|
19
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-motd', :branch => 'main'
|
20
20
|
EOS
|
21
21
|
|
22
|
-
proxy_env_value = 'http://cattastic.net:3219'
|
23
|
-
|
24
22
|
#In-line files
|
25
23
|
r10k_conf = <<-CONF
|
26
24
|
cachedir: '/var/cache/r10k'
|
27
25
|
git:
|
28
26
|
provider: '#{git_provider}'
|
29
27
|
repositories:
|
30
|
-
- remote: '
|
28
|
+
- remote: 'https://something.else/repo'
|
31
29
|
proxy: 'http://foooooooo.unresolvable:3128'
|
32
30
|
sources:
|
33
31
|
control:
|
34
32
|
basedir: "#{env_path}"
|
35
|
-
remote:
|
33
|
+
remote: 'https://something.else/repo'
|
36
34
|
CONF
|
37
35
|
|
38
36
|
teardown do
|
39
|
-
master.clear_env_var('HTTP_PROXY')
|
40
|
-
|
41
37
|
step 'Restore Original "r10k" Config'
|
42
38
|
on(master, "mv #{r10k_config_bak_path} #{r10k_config_path}")
|
43
39
|
|
@@ -45,8 +41,6 @@ teardown do
|
|
45
41
|
clean_up_r10k(master, last_commit, git_environments_path)
|
46
42
|
end
|
47
43
|
|
48
|
-
master.add_env_var('HTTP_PROXY', proxy_env_value)
|
49
|
-
|
50
44
|
step 'Backup Current "r10k" Config'
|
51
45
|
on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
|
52
46
|
|
@@ -64,7 +58,8 @@ git_add_commit_push(master, 'production', 'add Puppetfile', git_environments_pat
|
|
64
58
|
|
65
59
|
#test
|
66
60
|
on(master, "#{r10k_fqp} deploy environment -p", :accept_all_exit_codes => true) do |r|
|
67
|
-
|
61
|
+
# Rugged as of 0.28 has a different error message than shellgit
|
62
|
+
regex = /((failed to resolve address for)|(Could not resolve proxy:)) foooooooo\.unresolvable/
|
68
63
|
assert(r.exit_code == 1, 'expected error code was not observed')
|
69
64
|
assert_match(regex, r.stderr, 'The expected error message was not observed' )
|
70
65
|
end
|
@@ -5,7 +5,7 @@ test_name 'CODEMGMT-92 - C59235 - Single Git Source Using "GIT" Transport Protoc
|
|
5
5
|
|
6
6
|
confine(:to, :platform => 'el')
|
7
7
|
|
8
|
-
if fact_on(master, "
|
8
|
+
if fact_on(master, "os.release.major").to_i < 6 || fact_on(master, "os.release.major").to_i > 8
|
9
9
|
skip_test('This version of EL is not supported by this test case!')
|
10
10
|
end
|
11
11
|
|
@@ -84,9 +84,6 @@ teardown do
|
|
84
84
|
end
|
85
85
|
|
86
86
|
#Setup
|
87
|
-
step 'Stub Forge on Master'
|
88
|
-
stub_forge_on(master)
|
89
|
-
|
90
87
|
step 'Backup Current "r10k" Config'
|
91
88
|
on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
|
92
89
|
|
@@ -29,11 +29,11 @@ CONF
|
|
29
29
|
# Install the same module in two different places
|
30
30
|
puppetfile = <<-EOS
|
31
31
|
mod 'prod_apache',
|
32
|
-
:git => '
|
32
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-apache.git',
|
33
33
|
:tag => 'v6.0.0'
|
34
34
|
|
35
35
|
mod 'test_apache',
|
36
|
-
:git => '
|
36
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-apache.git',
|
37
37
|
:tag => 'v6.0.0'
|
38
38
|
EOS
|
39
39
|
|
@@ -44,9 +44,6 @@ teardown do
|
|
44
44
|
clean_up_r10k(master, last_commit, git_environments_path)
|
45
45
|
end
|
46
46
|
|
47
|
-
step 'Stub the forge'
|
48
|
-
stub_forge_on(master)
|
49
|
-
|
50
47
|
step 'Backup Current "r10k" Config'
|
51
48
|
on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
|
52
49
|
|
@@ -44,7 +44,7 @@ scp_to(master, helloworld_module_path, File.join(git_clone_module_path, 'hellowo
|
|
44
44
|
git_add_commit_push(master, 'master', 'Add module.', git_clone_module_path)
|
45
45
|
|
46
46
|
step 'Add "helloworld" Module Git Repo as Submodule'
|
47
|
-
on(master, "cd #{git_environments_path};git submodule add file://#{git_repo_module_path} dist")
|
47
|
+
on(master, "cd #{git_environments_path};git -c protocol.file.allow=always submodule add file://#{git_repo_module_path} dist")
|
48
48
|
|
49
49
|
step 'Checkout "production" Branch'
|
50
50
|
git_on(master, 'checkout production', git_environments_path)
|
@@ -68,6 +68,6 @@ on(master, "chmod 600 #{ssh_private_key_path}")
|
|
68
68
|
|
69
69
|
#Tests
|
70
70
|
step 'Attempt to Deploy via r10k'
|
71
|
-
on(master, "#{r10k_fqp} deploy environment -v", :acceptable_exit_codes => 1) do |result|
|
71
|
+
on(master, "SSH_AUTH_SOCK= SSH_CONNECTION= SSH_CLIENT= #{r10k_fqp} deploy environment -v", :acceptable_exit_codes => 1) do |result|
|
72
72
|
assert_match(error_message_regex, result.stderr, 'Expected message not found!')
|
73
73
|
end
|
@@ -30,12 +30,12 @@ CONF
|
|
30
30
|
puppetfile = <<-EOS
|
31
31
|
mod 'non_module_object_1',
|
32
32
|
:install_path => './',
|
33
|
-
:git => '
|
33
|
+
:git => 'https://github.com/puppetlabs/control-repo.git',
|
34
34
|
:branch => 'production'
|
35
35
|
|
36
36
|
mod 'non_module_object_2',
|
37
37
|
:install_path => '',
|
38
|
-
:git => '
|
38
|
+
:git => 'https://github.com/puppetlabs/control-repo.git',
|
39
39
|
:branch => 'production'
|
40
40
|
EOS
|
41
41
|
|
@@ -50,9 +50,6 @@ teardown do
|
|
50
50
|
clean_up_r10k(master, last_commit, git_environments_path)
|
51
51
|
end
|
52
52
|
|
53
|
-
step 'Stub the forge'
|
54
|
-
stub_forge_on(master)
|
55
|
-
|
56
53
|
step 'Backup Current "r10k" Config'
|
57
54
|
on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
|
58
55
|
|
@@ -51,9 +51,6 @@ fake_file_b_to_be_left_alone = "#{fake_environment_path_b}/fakefile2.txt"
|
|
51
51
|
fake_file_c_to_be_purged = "#{fake_environment_path_c}/fakefile3.txt"
|
52
52
|
|
53
53
|
# initalize file content
|
54
|
-
step 'Stub the forge'
|
55
|
-
stub_forge_on(master)
|
56
|
-
|
57
54
|
step 'Backup Current "r10k" Config'
|
58
55
|
on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
|
59
56
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'git_utils'
|
2
2
|
require 'r10k_utils'
|
3
3
|
require 'master_manipulator'
|
4
|
-
test_name 'RK-257 - C98046 - r10k does not purge files on
|
4
|
+
test_name 'RK-257 - C98046 - r10k does not purge files on allowlist'
|
5
5
|
|
6
6
|
#Init
|
7
7
|
env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
|
@@ -26,9 +26,6 @@ teardown do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
# initalize file content
|
29
|
-
step 'Stub the forge'
|
30
|
-
stub_forge_on(master)
|
31
|
-
|
32
29
|
step 'Backup Current "r10k" Config'
|
33
30
|
on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
|
34
31
|
|
@@ -42,7 +39,7 @@ sources:
|
|
42
39
|
remote: "#{git_control_remote}"
|
43
40
|
deploy:
|
44
41
|
purge_levels: ['deployment', 'environment', 'puppetfile']
|
45
|
-
|
42
|
+
purge_allowlist: ['**/*.pp']
|
46
43
|
CONF
|
47
44
|
|
48
45
|
step 'Update the "r10k" Config'
|
@@ -27,7 +27,7 @@ stdlib_notify_message_regex = /The test message is:.*one.*=>.*1.*two.*=>.*bats.*
|
|
27
27
|
puppet_file = <<-PUPPETFILE
|
28
28
|
mod "puppetlabs/motd"
|
29
29
|
mod 'puppetlabs/stdlib',
|
30
|
-
:git => '
|
30
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git',
|
31
31
|
:tag => 'v7.0.1'
|
32
32
|
PUPPETFILE
|
33
33
|
|
@@ -62,9 +62,6 @@ teardown do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
#Setup
|
65
|
-
step 'Stub Forge on Master'
|
66
|
-
stub_forge_on(master)
|
67
|
-
|
68
65
|
env_names.each do |env|
|
69
66
|
if env == 'production'
|
70
67
|
step "Checkout \"#{env}\" Branch"
|
data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb
CHANGED
@@ -31,7 +31,7 @@ puppet_file = <<-PUPPETFILE
|
|
31
31
|
moduledir '#{@module_path}'
|
32
32
|
mod "puppetlabs/motd"
|
33
33
|
mod 'puppetlabs/stdlib',
|
34
|
-
:git => '
|
34
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git',
|
35
35
|
:tag => 'v7.0.1'
|
36
36
|
PUPPETFILE
|
37
37
|
|
@@ -66,9 +66,6 @@ teardown do
|
|
66
66
|
end
|
67
67
|
|
68
68
|
#Setup
|
69
|
-
step 'Stub Forge on Master'
|
70
|
-
stub_forge_on(master)
|
71
|
-
|
72
69
|
env_names.each do |env|
|
73
70
|
if env == 'production'
|
74
71
|
step "Checkout \"#{env}\" Branch"
|
@@ -65,7 +65,7 @@ env_structs = {:production => GitEnv.new('/git_repos',
|
|
65
65
|
'/git_repos_alt/environments_alt.git',
|
66
66
|
'/root/environments_alt',
|
67
67
|
'/root/environments_alt/Puppetfile',
|
68
|
-
'mod "puppetlabs/stdlib", :git => "
|
68
|
+
'mod "puppetlabs/stdlib", :git => "https://github.com/puppetlabs/puppetlabs-stdlib.git", :tag => "v7.0.1"',
|
69
69
|
'/root/environments_alt/manifests/site.pp',
|
70
70
|
create_site_pp(master_certname, stage_env_manifest)
|
71
71
|
),
|
@@ -102,9 +102,6 @@ teardown do
|
|
102
102
|
end
|
103
103
|
|
104
104
|
#Setup
|
105
|
-
step 'Stub Forge on Master'
|
106
|
-
stub_forge_on(master)
|
107
|
-
|
108
105
|
step 'Backup Current "r10k" Config'
|
109
106
|
on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
|
110
107
|
|
@@ -15,7 +15,7 @@ r10k_fqp = get_r10k_fqp(master)
|
|
15
15
|
|
16
16
|
#File
|
17
17
|
puppet_file = <<-PUPPETFILE
|
18
|
-
mod 'broken', :git => '
|
18
|
+
mod 'broken', :git => 'https://github.com/puppetlabs/puppetlabs-broken'
|
19
19
|
PUPPETFILE
|
20
20
|
|
21
21
|
puppet_file_path = File.join(git_environments_path, 'Puppetfile')
|
@@ -2,7 +2,7 @@ require 'git_utils'
|
|
2
2
|
require 'r10k_utils'
|
3
3
|
test_name 'CODEMGMT-86 - C59265 - Attempt to Deploy Environment to Disk with Insufficient Free Space'
|
4
4
|
|
5
|
-
if fact_on(master, '
|
5
|
+
if fact_on(master, 'os.family') == 'RedHat' and fact_on(master, "os.release.major").to_i < 6
|
6
6
|
skip_test('This version of EL is not supported by this test case!')
|
7
7
|
end
|
8
8
|
|
@@ -19,7 +19,7 @@ PUPPETFILE
|
|
19
19
|
puppet_file_path = File.join(git_environments_path, 'Puppetfile')
|
20
20
|
|
21
21
|
#Verification
|
22
|
-
error_message_regex = /Error: Could not connect via HTTPS to https:\/\/forgeapi.
|
22
|
+
error_message_regex = /Error: Could not connect via HTTPS to https:\/\/forgeapi.puppet(labs)?.com/
|
23
23
|
|
24
24
|
#Teardown
|
25
25
|
teardown do
|
@@ -34,7 +34,8 @@ step 'Backup "/etc/hosts" File on Master'
|
|
34
34
|
on(master, "mv #{hosts_file_path} #{hosts_file_path}.bak")
|
35
35
|
|
36
36
|
step 'Point Forge Hostname to Localhost'
|
37
|
-
on(master, "echo '127.0.0.1 forgeapi.
|
37
|
+
on(master, "echo '127.0.0.1 forgeapi.puppet.com' > #{hosts_file_path}")
|
38
|
+
on(master, "echo '127.0.0.1 forgeapi.puppetlabs.com' >> #{hosts_file_path}")
|
38
39
|
|
39
40
|
step 'Checkout "production" Branch'
|
40
41
|
git_on(master, 'checkout production', git_environments_path)
|
data/integration/tests/user_scenario/basic_workflow/negative/neg_specify_deleted_forge_module.rb
CHANGED
@@ -10,7 +10,7 @@ last_commit = git_last_commit(master, git_environments_path)
|
|
10
10
|
r10k_fqp = get_r10k_fqp(master)
|
11
11
|
|
12
12
|
#Verification
|
13
|
-
error_notification_regex = /The module puppetlabs-regret does not appear to have any published releases/
|
13
|
+
error_notification_regex = /(The module puppetlabs-regret does not appear to have any published releases)|(module puppetlabs-regret does not exist on)/
|
14
14
|
|
15
15
|
#File
|
16
16
|
puppet_file = <<-PUPPETFILE
|
@@ -24,10 +24,6 @@ teardown do
|
|
24
24
|
clean_up_r10k(master, last_commit, git_environments_path)
|
25
25
|
end
|
26
26
|
|
27
|
-
#Setup
|
28
|
-
step 'Stub Forge on Master'
|
29
|
-
stub_forge_on(master)
|
30
|
-
|
31
27
|
#Tests
|
32
28
|
step 'Checkout "production" Branch'
|
33
29
|
git_on(master, 'checkout production', git_environments_path)
|
@@ -3,7 +3,7 @@ require 'r10k_utils'
|
|
3
3
|
require 'master_manipulator'
|
4
4
|
test_name 'CODEMGMT-62 - C59239 - Single Environment with 10,000 Files'
|
5
5
|
|
6
|
-
if fact_on(master, '
|
6
|
+
if fact_on(master, 'os.family') == 'RedHat' and fact_on(master, "os.release.major").to_i < 6
|
7
7
|
skip_test('This version of EL is not supported by this test case!')
|
8
8
|
end
|
9
9
|
|
@@ -28,7 +28,7 @@ notify_message_regex = /I am in the production environment/
|
|
28
28
|
puppet_file = <<-PUPPETFILE
|
29
29
|
mod "puppetlabs/motd"
|
30
30
|
mod 'puppetlabs/inifile',
|
31
|
-
:git => '
|
31
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-inifile',
|
32
32
|
:tag => 'v5.0.1'
|
33
33
|
PUPPETFILE
|
34
34
|
|
@@ -64,9 +64,6 @@ teardown do
|
|
64
64
|
end
|
65
65
|
|
66
66
|
#Setup
|
67
|
-
step 'Stub Forge on Master'
|
68
|
-
stub_forge_on(master)
|
69
|
-
|
70
67
|
step 'Checkout "production" Branch'
|
71
68
|
git_on(master, 'checkout production', git_environments_path)
|
72
69
|
|