r10k 3.15.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (240) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +17 -0
  3. data/.github/workflows/docker.yml +4 -4
  4. data/.github/workflows/release.yml +2 -2
  5. data/.github/workflows/rspec_tests.yml +10 -11
  6. data/.github/workflows/stale.yml +1 -1
  7. data/CHANGELOG.mkd +66 -0
  8. data/CODEOWNERS +1 -2
  9. data/Gemfile +2 -2
  10. data/README.mkd +16 -17
  11. data/doc/common-patterns.mkd +1 -2
  12. data/doc/dynamic-environments/configuration.mkd +78 -2
  13. data/doc/puppetfile.mkd +9 -3
  14. data/integration/Gemfile +1 -1
  15. data/integration/Rakefile +1 -1
  16. data/integration/files/pre-suite/git_config.pp.erb +1 -1
  17. data/integration/pre-suite/00_pe_install.rb +3 -0
  18. data/integration/pre-suite/10_git_config.rb +0 -3
  19. data/integration/tests/Puppetfile/HTTP_PROXY_affects_git_source.rb +5 -4
  20. data/integration/tests/basic_functionality/negative/negative_bad_proxy.rb +1 -1
  21. data/integration/tests/basic_functionality/proxy_specified_in_configuration.rb +2 -2
  22. data/integration/tests/basic_functionality/proxy_with_puppetfile.rb +2 -2
  23. data/integration/tests/basic_functionality/rugged_git_provider_with_ssh.rb +3 -3
  24. data/integration/tests/basic_functionality/rugged_git_provider_without_ssh.rb +3 -3
  25. data/integration/tests/command_line/deploy_env_without_mod_update.rb +0 -3
  26. data/integration/tests/command_line/negative/neg_deploy_env_with_module_update.rb +0 -3
  27. data/integration/tests/git_source/HTTP_proxy_and_git_source.rb +5 -10
  28. data/integration/tests/git_source/git_source_git.rb +1 -4
  29. data/integration/tests/git_source/git_source_repeated_remote.rb +0 -3
  30. data/integration/tests/git_source/git_source_submodule.rb +1 -1
  31. data/integration/tests/git_source/negative/neg_git_unauthorized_ssh.rb +1 -1
  32. data/integration/tests/purging/content_not_purged_at_root.rb +0 -3
  33. data/integration/tests/purging/default_purging.rb +0 -3
  34. data/integration/tests/purging/{does_not_purge_files_on_white_list.rb → does_not_purge_files_on_allowlist.rb} +2 -5
  35. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb +0 -3
  36. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb +0 -3
  37. data/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb +0 -3
  38. data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_forge_module.rb +0 -3
  39. data/integration/tests/user_scenario/basic_workflow/negative/neg_disk_full.rb +1 -1
  40. data/integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb +0 -3
  41. data/integration/tests/user_scenario/basic_workflow/negative/neg_inaccessible_forge.rb +3 -2
  42. data/integration/tests/user_scenario/basic_workflow/negative/neg_specify_deleted_forge_module.rb +1 -5
  43. data/integration/tests/user_scenario/basic_workflow/single_env_10000_files.rb +1 -1
  44. data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb +0 -3
  45. data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_module.rb +0 -3
  46. data/integration/tests/user_scenario/basic_workflow/single_env_large_files.rb +1 -1
  47. data/integration/tests/user_scenario/basic_workflow/single_env_module_already_installed.rb +0 -3
  48. data/integration/tests/user_scenario/basic_workflow/single_env_purge_unmanaged_modules.rb +0 -3
  49. data/integration/tests/user_scenario/basic_workflow/single_env_switch_forge_git_module.rb +0 -3
  50. data/integration/tests/user_scenario/basic_workflow/single_env_upgrade_forge_mod_revert_change.rb +0 -3
  51. data/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb +0 -3
  52. data/lib/r10k/action/deploy/environment.rb +2 -19
  53. data/lib/r10k/action/deploy/module.rb +1 -0
  54. data/lib/r10k/action/puppetfile/check.rb +7 -0
  55. data/lib/r10k/action/puppetfile/install.rb +3 -1
  56. data/lib/r10k/cli/deploy.rb +15 -1
  57. data/lib/r10k/cli/puppetfile.rb +1 -0
  58. data/lib/r10k/content_synchronizer.rb +7 -2
  59. data/lib/r10k/environment.rb +0 -1
  60. data/lib/r10k/git/rugged/bare_repository.rb +4 -3
  61. data/lib/r10k/git/rugged/working_repository.rb +7 -5
  62. data/lib/r10k/git/shellgit/working_repository.rb +3 -3
  63. data/lib/r10k/git/stateful_repository.rb +2 -2
  64. data/lib/r10k/module/base.rb +3 -3
  65. data/lib/r10k/module/git.rb +18 -4
  66. data/lib/r10k/module_loader/puppetfile.rb +14 -9
  67. data/lib/r10k/puppetfile.rb +1 -1
  68. data/lib/r10k/settings.rb +6 -7
  69. data/lib/r10k/version.rb +1 -1
  70. data/locales/r10k.pot +34 -82
  71. data/r10k.gemspec +5 -7
  72. metadata +22 -211
  73. data/docker/.gitignore +0 -1
  74. data/docker/.rspec +0 -4
  75. data/docker/Gemfile +0 -11
  76. data/docker/Makefile +0 -99
  77. data/docker/README.md +0 -28
  78. data/docker/docker-compose.yml +0 -18
  79. data/docker/r10k/Dockerfile +0 -68
  80. data/docker/r10k/adduser.sh +0 -13
  81. data/docker/r10k/docker-entrypoint.d/10-analytics.sh +0 -30
  82. data/docker/r10k/docker-entrypoint.sh +0 -10
  83. data/docker/r10k/release.Dockerfile +0 -55
  84. data/docker/spec/dockerfile_spec.rb +0 -37
  85. data/docker/spec/fixtures/Puppetfile +0 -2
  86. data/integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb +0 -83
  87. data/integration/tests/basic_functionality/proxy_with_pe_only_module.rb +0 -128
  88. data/integration/tests/purging/invalid_whitelist_types.rb +0 -63
  89. data/integration/tests/user_scenario/basic_workflow/negative/neg_module_specified_at_deleted_release.rb +0 -49
  90. data/integration/tests/user_scenario/basic_workflow/single_env_module_last_release_deleted.rb +0 -68
  91. data/lib/r10k/environment/bare.rb +0 -13
  92. data/spec/fixtures/empty/.empty +0 -0
  93. data/spec/fixtures/integration/git/puppet-boolean-bare.tar +0 -0
  94. data/spec/fixtures/module/forge/bad_module/metadata.json +0 -1
  95. data/spec/fixtures/module/forge/eight_hundred/Modulefile +0 -8
  96. data/spec/fixtures/module/forge/eight_hundred/metadata.json +0 -19
  97. data/spec/fixtures/tarball/tarball.tar.gz +0 -0
  98. data/spec/fixtures/unit/action/r10k.yaml +0 -5
  99. data/spec/fixtures/unit/action/r10k_cachedir.yaml +0 -2
  100. data/spec/fixtures/unit/action/r10k_creds.yaml +0 -9
  101. data/spec/fixtures/unit/action/r10k_forge_auth.yaml +0 -4
  102. data/spec/fixtures/unit/action/r10k_forge_auth_no_url.yaml +0 -3
  103. data/spec/fixtures/unit/action/r10k_generate_types.yaml +0 -3
  104. data/spec/fixtures/unit/action/r10k_logging.yaml +0 -12
  105. data/spec/fixtures/unit/action/r10k_puppet_path.yaml +0 -3
  106. data/spec/fixtures/unit/puppetfile/argument-error/Puppetfile +0 -1
  107. data/spec/fixtures/unit/puppetfile/default-branch-override/Puppetfile +0 -5
  108. data/spec/fixtures/unit/puppetfile/duplicate-module-error/Puppetfile +0 -10
  109. data/spec/fixtures/unit/puppetfile/forge-override/Puppetfile +0 -8
  110. data/spec/fixtures/unit/puppetfile/invalid-syntax/Puppetfile +0 -1
  111. data/spec/fixtures/unit/puppetfile/load-error/Puppetfile +0 -1
  112. data/spec/fixtures/unit/puppetfile/name-error/Puppetfile +0 -1
  113. data/spec/fixtures/unit/puppetfile/valid-forge-with-version/Puppetfile +0 -1
  114. data/spec/fixtures/unit/puppetfile/valid-forge-without-version/Puppetfile +0 -1
  115. data/spec/fixtures/unit/puppetfile/various-modules/Puppetfile +0 -10
  116. data/spec/fixtures/unit/puppetfile/various-modules/Puppetfile.new +0 -10
  117. data/spec/fixtures/unit/puppetfile/various-modules/modules/apt/.gitkeep +0 -1
  118. data/spec/fixtures/unit/puppetfile/various-modules/modules/baz/.gitkeep +0 -1
  119. data/spec/fixtures/unit/puppetfile/various-modules/modules/buzz/.gitkeep +0 -1
  120. data/spec/fixtures/unit/puppetfile/various-modules/modules/canary/.gitkeep +0 -1
  121. data/spec/fixtures/unit/puppetfile/various-modules/modules/fizz/.gitkeep +0 -1
  122. data/spec/fixtures/unit/puppetfile/various-modules/modules/rpm/.gitkeep +0 -1
  123. data/spec/fixtures/unit/util/purgeable/managed_one/expected_1 +0 -0
  124. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/managed_symlink_file +0 -1
  125. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/subdir_allowlisted_2/ignored_1 +0 -0
  126. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/subdir_expected_1 +0 -0
  127. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/subdir_unmanaged_1 +0 -0
  128. data/spec/fixtures/unit/util/purgeable/managed_one/managed_subdir_1/unmanaged_symlink_dir +0 -1
  129. data/spec/fixtures/unit/util/purgeable/managed_one/managed_symlink_dir +0 -1
  130. data/spec/fixtures/unit/util/purgeable/managed_one/unmanaged_1 +0 -0
  131. data/spec/fixtures/unit/util/purgeable/managed_one/unmanaged_symlink_file +0 -1
  132. data/spec/fixtures/unit/util/purgeable/managed_two/.hidden/unmanaged_3 +0 -0
  133. data/spec/fixtures/unit/util/purgeable/managed_two/expected_2 +0 -0
  134. data/spec/fixtures/unit/util/purgeable/managed_two/unmanaged_2 +0 -0
  135. data/spec/fixtures/unit/util/subprocess/runner/no-execute.sh +0 -3
  136. data/spec/integration/git/rugged/bare_repository_spec.rb +0 -13
  137. data/spec/integration/git/rugged/cache_spec.rb +0 -33
  138. data/spec/integration/git/rugged/thin_repository_spec.rb +0 -14
  139. data/spec/integration/git/rugged/working_repository_spec.rb +0 -48
  140. data/spec/integration/git/shellgit/bare_repository_spec.rb +0 -13
  141. data/spec/integration/git/shellgit/thin_repository_spec.rb +0 -14
  142. data/spec/integration/git/shellgit/working_repository_spec.rb +0 -13
  143. data/spec/integration/git/stateful_repository_spec.rb +0 -175
  144. data/spec/integration/util/purageable_spec.rb +0 -41
  145. data/spec/matchers/exit_with.rb +0 -28
  146. data/spec/matchers/match_realpath.rb +0 -18
  147. data/spec/r10k-mocks/mock_config.rb +0 -33
  148. data/spec/r10k-mocks/mock_env.rb +0 -18
  149. data/spec/r10k-mocks/mock_source.rb +0 -17
  150. data/spec/r10k-mocks.rb +0 -3
  151. data/spec/shared-contexts/git-fixtures.rb +0 -55
  152. data/spec/shared-contexts/tarball.rb +0 -32
  153. data/spec/shared-examples/deploy-actions.rb +0 -69
  154. data/spec/shared-examples/git/bare_repository.rb +0 -132
  155. data/spec/shared-examples/git/thin_repository.rb +0 -26
  156. data/spec/shared-examples/git/working_repository.rb +0 -207
  157. data/spec/shared-examples/git-repository.rb +0 -38
  158. data/spec/shared-examples/puppetfile-action.rb +0 -39
  159. data/spec/shared-examples/settings/ancestry.rb +0 -44
  160. data/spec/shared-examples/subprocess-runner.rb +0 -89
  161. data/spec/spec_helper.rb +0 -41
  162. data/spec/unit/action/cri_runner_spec.rb +0 -72
  163. data/spec/unit/action/deploy/deploy_helpers_spec.rb +0 -38
  164. data/spec/unit/action/deploy/display_spec.rb +0 -61
  165. data/spec/unit/action/deploy/environment_spec.rb +0 -640
  166. data/spec/unit/action/deploy/module_spec.rb +0 -476
  167. data/spec/unit/action/puppetfile/check_spec.rb +0 -53
  168. data/spec/unit/action/puppetfile/cri_runner_spec.rb +0 -47
  169. data/spec/unit/action/puppetfile/install_spec.rb +0 -112
  170. data/spec/unit/action/puppetfile/purge_spec.rb +0 -60
  171. data/spec/unit/action/runner_spec.rb +0 -407
  172. data/spec/unit/action/visitor_spec.rb +0 -39
  173. data/spec/unit/cli_spec.rb +0 -9
  174. data/spec/unit/deployment/config_spec.rb +0 -33
  175. data/spec/unit/deployment_spec.rb +0 -162
  176. data/spec/unit/environment/bare_spec.rb +0 -13
  177. data/spec/unit/environment/base_spec.rb +0 -122
  178. data/spec/unit/environment/git_spec.rb +0 -114
  179. data/spec/unit/environment/name_spec.rb +0 -181
  180. data/spec/unit/environment/plain_spec.rb +0 -8
  181. data/spec/unit/environment/svn_spec.rb +0 -146
  182. data/spec/unit/environment/tarball_spec.rb +0 -45
  183. data/spec/unit/environment/with_modules_spec.rb +0 -122
  184. data/spec/unit/errors/formatting_spec.rb +0 -84
  185. data/spec/unit/feature_spec.rb +0 -50
  186. data/spec/unit/forge/module_release_spec.rb +0 -213
  187. data/spec/unit/git/alternates_spec.rb +0 -116
  188. data/spec/unit/git/cache_spec.rb +0 -66
  189. data/spec/unit/git/rugged/cache_spec.rb +0 -48
  190. data/spec/unit/git/rugged/credentials_spec.rb +0 -215
  191. data/spec/unit/git/shellgit/cache_spec.rb +0 -27
  192. data/spec/unit/git/stateful_repository_spec.rb +0 -45
  193. data/spec/unit/git_spec.rb +0 -102
  194. data/spec/unit/initializers_spec.rb +0 -68
  195. data/spec/unit/instance_cache_spec.rb +0 -78
  196. data/spec/unit/keyed_factory_spec.rb +0 -51
  197. data/spec/unit/logging/terminaloutputter_spec.rb +0 -53
  198. data/spec/unit/logging_spec.rb +0 -68
  199. data/spec/unit/module/base_spec.rb +0 -118
  200. data/spec/unit/module/forge_spec.rb +0 -271
  201. data/spec/unit/module/git_spec.rb +0 -387
  202. data/spec/unit/module/metadata_file_spec.rb +0 -68
  203. data/spec/unit/module/svn_spec.rb +0 -208
  204. data/spec/unit/module/tarball_spec.rb +0 -70
  205. data/spec/unit/module_loader/puppetfile_spec.rb +0 -421
  206. data/spec/unit/module_spec.rb +0 -114
  207. data/spec/unit/puppetfile_spec.rb +0 -304
  208. data/spec/unit/settings/collection_spec.rb +0 -123
  209. data/spec/unit/settings/container_spec.rb +0 -92
  210. data/spec/unit/settings/definition_spec.rb +0 -79
  211. data/spec/unit/settings/enum_definition_spec.rb +0 -20
  212. data/spec/unit/settings/inheritance_spec.rb +0 -38
  213. data/spec/unit/settings/list_spec.rb +0 -88
  214. data/spec/unit/settings/loader_spec.rb +0 -110
  215. data/spec/unit/settings/uri_definition_spec.rb +0 -23
  216. data/spec/unit/settings_spec.rb +0 -303
  217. data/spec/unit/source/base_spec.rb +0 -31
  218. data/spec/unit/source/exec_spec.rb +0 -81
  219. data/spec/unit/source/git_spec.rb +0 -233
  220. data/spec/unit/source/hash_spec.rb +0 -54
  221. data/spec/unit/source/svn_spec.rb +0 -196
  222. data/spec/unit/source/yaml_spec.rb +0 -42
  223. data/spec/unit/source_spec.rb +0 -10
  224. data/spec/unit/svn/remote_spec.rb +0 -21
  225. data/spec/unit/svn/working_dir_spec.rb +0 -56
  226. data/spec/unit/tarball_spec.rb +0 -57
  227. data/spec/unit/util/attempt_spec.rb +0 -82
  228. data/spec/unit/util/cacheable_spec.rb +0 -23
  229. data/spec/unit/util/commands_spec.rb +0 -61
  230. data/spec/unit/util/downloader_spec.rb +0 -98
  231. data/spec/unit/util/exec_env_spec.rb +0 -56
  232. data/spec/unit/util/purgeable_spec.rb +0 -267
  233. data/spec/unit/util/setopts_spec.rb +0 -83
  234. data/spec/unit/util/subprocess/result_spec.rb +0 -36
  235. data/spec/unit/util/subprocess/runner/posix_spec.rb +0 -7
  236. data/spec/unit/util/subprocess/runner/pump_spec.rb +0 -79
  237. data/spec/unit/util/subprocess/runner/windows_spec.rb +0 -7
  238. data/spec/unit/util/subprocess/subprocess_error_spec.rb +0 -26
  239. data/spec/unit/util/subprocess_spec.rb +0 -65
  240. data/spec/unit/util/symbolize_keys_spec.rb +0 -67
@@ -1,55 +0,0 @@
1
- ARG alpine_version=3.14
2
- FROM alpine:${alpine_version}
3
-
4
- ARG vcs_ref
5
- ARG build_date
6
- ARG version="3.1.0"
7
- # Used by entrypoint to submit metrics to Google Analytics.
8
- # Published images should use "production" for this build_arg.
9
- ARG pupperware_analytics_stream="dev"
10
- # required to schedule runs of "r10k" in K8s
11
- ARG supercronic_version="0.1.9"
12
- ARG supercronic_sha1sum="5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85"
13
- ARG supercronic="supercronic-linux-amd64"
14
- ARG supercronic_url="https://github.com/aptible/supercronic/releases/download/v$supercronic_version/$supercronic"
15
-
16
- LABEL org.label-schema.maintainer="Puppet Release Team <release@puppet.com>" \
17
- org.label-schema.vendor="Puppet" \
18
- org.label-schema.url="https://github.com/puppetlabs/r10k" \
19
- org.label-schema.name="r10k" \
20
- org.label-schema.license="Apache-2.0" \
21
- org.label-schema.vcs-url="https://github.com/puppetlabs/r10k" \
22
- org.label-schema.schema-version="1.0" \
23
- org.label-schema.dockerfile="/release.Dockerfile"
24
-
25
- COPY adduser.sh docker-entrypoint.sh /
26
- COPY docker-entrypoint.d /docker-entrypoint.d
27
-
28
- ENTRYPOINT ["/docker-entrypoint.sh"]
29
- CMD ["help"]
30
-
31
- # dyanmic LABELs and ENV vars placed lower for the sake of Docker layer caching
32
- ENV PUPPERWARE_ANALYTICS_STREAM="$pupperware_analytics_stream"
33
-
34
- LABEL org.label-schema.version="$version" \
35
- org.label-schema.vcs-ref="$vcs_ref" \
36
- org.label-schema.build-date="$build_date"
37
-
38
- SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
39
- # ignore apk and gem pinning
40
- # hadolint ignore=DL3018,DL3028
41
- RUN chmod a+x /adduser.sh /docker-entrypoint.sh /docker-entrypoint.d/*.sh && \
42
- /adduser.sh && \
43
- chown -R puppet: /docker-entrypoint.d /docker-entrypoint.sh && \
44
- apk add --no-cache ruby openssh-client git ruby-rugged curl ruby-dev make gcc musl-dev && \
45
- gem install --no-doc r10k:"$version" json etc && \
46
- curl --fail --silent --show-error --location --remote-name "$supercronic_url" && \
47
- echo "${supercronic_sha1sum} ${supercronic}" | sha1sum -c - && \
48
- chmod +x "$supercronic" && \
49
- mv "$supercronic" "/usr/local/bin/${supercronic}" && \
50
- ln -s "/usr/local/bin/${supercronic}" /usr/local/bin/supercronic
51
-
52
- USER puppet
53
- WORKDIR /home/puppet
54
-
55
- COPY release.Dockerfile /
@@ -1,37 +0,0 @@
1
- require 'rspec/core'
2
- require 'fileutils'
3
- require 'open3'
4
- include Pupperware::SpecHelpers
5
-
6
- ENV['SPEC_DIRECTORY'] = File.dirname(__FILE__)
7
- # unifies volume naming
8
- ENV['COMPOSE_PROJECT_NAME'] ||= 'r10k'
9
-
10
- RSpec.configure do |c|
11
- c.before(:suite) do
12
- ENV['R10K_IMAGE'] = require_test_image
13
- pull_images(['r10k_check','r10k_install'])
14
- teardown_cluster()
15
- # no certs to preload, but if the suite adds puppetserver, be explicit
16
- docker_compose_up(preload_certs: true)
17
- end
18
-
19
- c.after(:suite) do
20
- teardown_cluster()
21
- FileUtils.rm_rf(File.join(ENV['SPEC_DIRECTORY'], 'fixtures', 'modules'))
22
- end
23
- end
24
-
25
- describe 'r10k container' do
26
- {
27
- 'r10k_check': 'validate',
28
- 'r10k_install': 'install',
29
- }.each do |container, op|
30
- it "should #{op} the Puppetfile" do
31
- container = get_service_container(container)
32
- wait_on_container_exit(container)
33
- expect(get_container_exit_code(container)).to eq(0)
34
- emit_log(container)
35
- end
36
- end
37
- end
@@ -1,2 +0,0 @@
1
- moduledir '/tmp/modules'
2
- mod 'puppetlabs/ntp'
@@ -1,83 +0,0 @@
1
- require 'git_utils'
2
- require 'r10k_utils'
3
- require 'master_manipulator'
4
- test_name 'RK-158 - C92362 - Install a PE-only module from forge'
5
-
6
- #Init
7
- env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
8
- r10k_fqp = get_r10k_fqp(master)
9
- master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
10
-
11
- git_repo_path = '/git_repos'
12
- git_repo_name = 'environments'
13
- git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git")
14
- git_environments_path = '/root/environments'
15
- last_commit = git_last_commit(master, git_environments_path)
16
- git_provider = ENV['GIT_PROVIDER'] || 'shellgit'
17
-
18
- r10k_config_path = get_r10k_config_file_path(master)
19
- r10k_config_bak_path = "#{r10k_config_path}.bak"
20
-
21
- #In-line files
22
- r10k_conf = <<-CONF
23
- cachedir: '/var/cache/r10k'
24
- git:
25
- provider: '#{git_provider}'
26
- sources:
27
- control:
28
- basedir: "#{env_path}"
29
- remote: "#{git_control_remote}"
30
- CONF
31
-
32
- #Manifest
33
- site_pp_path = File.join(git_environments_path, 'manifests', 'site.pp')
34
- site_pp = create_site_pp(master_certname, ' include peonly')
35
-
36
- # Verification
37
- notify_message_regex = /I am in the production environment, this is a PE only module/
38
-
39
- #Teardown
40
- teardown do
41
- step 'remove license file'
42
- on(master, 'rm -f /etc/puppetlabs/license.key')
43
-
44
- step 'Restore Original "r10k" Config'
45
- on(master, "mv #{r10k_config_bak_path} #{r10k_config_path}")
46
-
47
- step 'cleanup r10k'
48
- clean_up_r10k(master, last_commit, git_environments_path)
49
- end
50
-
51
- #Setup
52
- step 'Stub the forge'
53
- stub_forge_on(master)
54
-
55
- step 'Backup a Valid "r10k" Config'
56
- on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
57
-
58
- step 'Update the "r10k" Config'
59
- create_remote_file(master, r10k_config_path, r10k_conf)
60
-
61
- step 'Download license file from artifactory'
62
- curl_on(master, 'https://artifactory.delivery.puppetlabs.net/artifactory/generic/r10k_test_license.key -o /etc/puppetlabs/license.key')
63
-
64
- step 'Inject New "site.pp" to the "production" Environment'
65
- inject_site_pp(master, site_pp_path, site_pp)
66
-
67
- step 'Copy Puppetfile to "production" Environment Git Repo'
68
- create_remote_file(master, "#{git_environments_path}/Puppetfile", 'mod "ztr-peonly"')
69
-
70
- step 'Push Changes'
71
- git_add_commit_push(master, 'production', 'add Puppetfile', git_environments_path)
72
-
73
- #Tests
74
- step 'Deploy "production" Environment via r10k'
75
- on(master, "#{r10k_fqp} deploy environment -p")
76
-
77
- agents.each do |agent|
78
- step "Run Puppet Agent"
79
- on(agent, puppet('agent', '--test', '--environment production'), :acceptable_exit_codes => 2) do |result|
80
- assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!')
81
- assert_match(notify_message_regex, result.stdout, 'Expected message not found!')
82
- end
83
- end
@@ -1,128 +0,0 @@
1
- require 'git_utils'
2
- require 'r10k_utils'
3
- require 'master_manipulator'
4
- test_name 'RK-242 '#'- C87652 - Specify the proxy in the r10k.yaml'
5
-
6
- confine(:to, :platform => ['el', 'sles'])
7
-
8
- #Init
9
- master_platform = fact_on(master, 'osfamily')
10
- master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
11
- env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
12
- r10k_fqp = get_r10k_fqp(master)
13
-
14
- git_repo_path = '/git_repos'
15
- git_repo_name = 'environments'
16
- git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git")
17
- git_environments_path = '/root/environments'
18
- last_commit = git_last_commit(master, git_environments_path)
19
- git_provider = ENV['GIT_PROVIDER']
20
-
21
- local_files_root_path = ENV['FILES'] || 'files'
22
-
23
- git_manifest_template_path = File.join(local_files_root_path, 'pre-suite', 'git_config.pp.erb')
24
- git_manifest = ERB.new(File.read(git_manifest_template_path)).result(binding)
25
-
26
- r10k_config_path = get_r10k_config_file_path(master)
27
- r10k_config_bak_path = "#{r10k_config_path}.bak"
28
-
29
- case master_platform
30
- when 'RedHat'
31
- pkg_manager = 'yum'
32
- when 'Suse'
33
- pkg_manager = 'zypper'
34
- end
35
-
36
- install_squid = "#{pkg_manager} install -y squid"
37
- remove_squid = "#{pkg_manager} remove -y squid"
38
- squid_log = "/var/log/squid/access.log"
39
-
40
- #In-line files
41
- r10k_conf = <<-CONF
42
- cachedir: '/var/cache/r10k'
43
- git:
44
- provider: '#{git_provider}'
45
- sources:
46
- control:
47
- basedir: "#{env_path}"
48
- remote: "#{git_control_remote}"
49
- forge:
50
- proxy: "http://#{master.hostname}:3128"
51
- CONF
52
-
53
- #Manifest
54
- site_pp_path = File.join(git_environments_path, 'manifests', 'site.pp')
55
- site_pp = create_site_pp(master_certname, ' include peonly')
56
-
57
- #Verification
58
- squid_log_regex = /CONNECT forgeapi.puppetlabs.com:443/
59
- notify_message_regex = /I am in the production environment, this is a PE only module/
60
-
61
- #Teardown
62
- teardown do
63
- step 'remove license file'
64
- on(master, 'rm -f /etc/puppetlabs/license.key')
65
-
66
- step 'Restore "git" Package'
67
- on(master, puppet('apply'), :stdin => git_manifest, :acceptable_exit_codes => [0,2])
68
-
69
- step 'Restore Original "r10k" Config'
70
- on(master, "mv #{r10k_config_bak_path} #{r10k_config_path}")
71
-
72
- clean_up_r10k(master, last_commit, git_environments_path)
73
-
74
- step 'Remove Squid'
75
- on(master, puppet("apply -e 'service {'squid' : ensure => stopped}'"))
76
- on(master, remove_squid)
77
- end
78
-
79
- #Setup
80
- step 'Stub the forge'
81
- stub_forge_on(master)
82
-
83
- step 'Backup Current "r10k" Config'
84
- on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
85
-
86
- step 'Update the "r10k" Config'
87
- create_remote_file(master, r10k_config_path, r10k_conf)
88
-
89
- step 'Download license file from artifactory'
90
- curl_on(master, 'https://artifactory.delivery.puppetlabs.net/artifactory/generic/r10k_test_license.key -o /etc/puppetlabs/license.key')
91
-
92
- step 'Checkout "production" Branch'
93
- git_on(master, 'checkout production', git_environments_path)
94
-
95
- step 'Inject New "site.pp" to the "production" Environment'
96
- inject_site_pp(master, site_pp_path, site_pp)
97
-
98
- step 'Copy Puppetfile to "production" Environment with PE only module'
99
- create_remote_file(master, "#{git_environments_path}/Puppetfile", 'mod "ztr-peonly"')
100
-
101
- step 'Push Changes'
102
- git_add_commit_push(master, 'production', 'add Puppetfile', git_environments_path)
103
-
104
- step 'Install and configure squid proxy'
105
- on(master, install_squid)
106
-
107
- step 'turn off the firewall'
108
- on(master, puppet("apply -e 'service {'iptables' : ensure => stopped}'"))
109
-
110
- step 'start squid proxy'
111
- on(master, puppet("apply -e 'service {'squid' : ensure => running}'"))
112
-
113
- #Tests
114
- step 'Deploy "production" Environment via r10k'
115
- on(master, "#{r10k_fqp} deploy environment -p")
116
-
117
- step 'Read the squid logs'
118
- on(master, "cat #{squid_log}") do |result|
119
- assert_match(squid_log_regex, result.stdout, 'Proxy logs did not indicate use of the proxy.')
120
- end
121
-
122
- agents.each do |agent|
123
- step "Run Puppet Agent"
124
- on(agent, puppet('agent', '--test', '--environment production'), :acceptable_exit_codes => [0,2]) do |result|
125
- assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!')
126
- assert_match(notify_message_regex, result.stdout, 'Expected message not found!')
127
- end
128
- end
@@ -1,63 +0,0 @@
1
- require 'git_utils'
2
- require 'r10k_utils'
3
- require 'master_manipulator'
4
- test_name 'RK-257 - C98043 - verify default whitelist only accepts strings or array of strings'
5
-
6
- #Init
7
- env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
8
- r10k_fqp = get_r10k_fqp(master)
9
- git_environments_path = '/root/environments'
10
-
11
- git_repo_path = '/git_repos'
12
- git_repo_name = 'environments'
13
- git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git")
14
-
15
- last_commit = git_last_commit(master, git_environments_path)
16
- git_provider = ENV['GIT_PROVIDER']
17
-
18
- r10k_config_path = get_r10k_config_file_path(master)
19
- r10k_config_bak_path = "#{r10k_config_path}.bak"
20
-
21
- #invalid content to test
22
- hash_whitelist = '{:cats => \'cats.txt\'}'
23
- invalid_array_content_whitelist = '[\'cats.txt\', [:broken]]'
24
-
25
- teardown do
26
- step 'Restore Original "r10k" Config'
27
- on(master, "mv #{r10k_config_bak_path} #{r10k_config_path}")
28
-
29
- clean_up_r10k(master, last_commit, git_environments_path)
30
- end
31
-
32
- # initalize file content
33
- step 'Stub the forge'
34
- stub_forge_on(master)
35
-
36
- step 'Backup Current "r10k" Config'
37
- on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
38
-
39
- [hash_whitelist, invalid_array_content_whitelist].each do |whitelist_content|
40
- r10k_conf = <<-CONF
41
- cachedir: '/var/cache/r10k'
42
- git:
43
- provider: '#{git_provider}'
44
- sources:
45
- control:
46
- basedir: "#{env_path}"
47
- remote: "#{git_control_remote}"
48
- deploy:
49
- purge_whitelist: #{whitelist_content}
50
- CONF
51
-
52
- step 'Update the "r10k" Config'
53
- create_remote_file(master, r10k_config_path, r10k_conf)
54
-
55
- step 'Deploy r10k, and verify that invalid whitelist content causes error'
56
- on(master, "#{r10k_fqp} deploy environment -p", :accept_all_exit_codes => true) do |result|
57
- error = /did not find expected node content while parsing a flow node/
58
- error_message = 'whitelist content did not generate expected error'
59
- expect_failure('RK-263') do
60
- assert_no_match(result.stdout, error, error_message)
61
- end
62
- end
63
- end
@@ -1,49 +0,0 @@
1
- require 'git_utils'
2
- require 'r10k_utils'
3
- test_name 'CODEMGMT-127 - C64121 - Attempt to Deploy Environment with Forge Module Specified at Deleted Release'
4
-
5
- #This test uses the spotty module at https://forge-aio01-petest.puppetlabs.com//puppetlabs/spotty, with valid released 0.1.0 and 0.3.0 versions, and deleted 0.2.0 and 0.4.0 versions.
6
-
7
- #Init
8
- git_environments_path = '/root/environments'
9
- last_commit = git_last_commit(master, git_environments_path)
10
- r10k_fqp = get_r10k_fqp(master)
11
-
12
- #Verification
13
- if get_puppet_version(master) < 4.0
14
- error_notification_regex = /No releases matching '0.2.0'/
15
- else
16
- error_notification_regex = /error.* -> The module release puppetlabs-spotty-0.2.0 does not exist on/i
17
- end
18
-
19
- #File
20
- puppet_file = <<-PUPPETFILE
21
- mod "puppetlabs/spotty", '0.2.0'
22
- PUPPETFILE
23
-
24
- puppet_file_path = File.join(git_environments_path, 'Puppetfile')
25
-
26
- #Teardown
27
- teardown do
28
- clean_up_r10k(master, last_commit, git_environments_path)
29
- end
30
-
31
- #Setup
32
- step 'Stub Forge on Master'
33
- stub_forge_on(master)
34
-
35
- #Tests
36
- step 'Checkout "production" Branch'
37
- git_on(master, 'checkout production', git_environments_path)
38
-
39
- step 'Create "Puppetfile" for the "production" Environment'
40
- create_remote_file(master, puppet_file_path, puppet_file)
41
-
42
- step 'Push Changes'
43
- git_add_commit_push(master, 'production', 'Add module.', git_environments_path)
44
-
45
- #Tests
46
- step "Deploy production environment via r10k with module specified at deleted version"
47
- on(master, "#{r10k_fqp} deploy environment -p -v", :acceptable_exit_codes => 1) do |result|
48
- assert_match(error_notification_regex, result.stderr, 'Unexpected error was detected!')
49
- end
@@ -1,68 +0,0 @@
1
- require 'git_utils'
2
- require 'r10k_utils'
3
- test_name 'CODEMGMT-127 - C64120 - Single Environment with Forge Module where Latest Release has been Deleted'
4
-
5
- #This test uses the spotty module at https://forge-aio01-petest.puppetlabs.com//puppetlabs/spotty, which has valid 0.1.0 and 0.3.0 versions, and deleted 0.2.0 and 0.4.0 versions.
6
-
7
- #Init
8
- env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
9
- prod_env_modules_path = File.join(env_path, 'production', 'modules')
10
- r10k_fqp = get_r10k_fqp(master)
11
-
12
- git_environments_path = '/root/environments'
13
- last_commit = git_last_commit(master, git_environments_path)
14
-
15
- #Verification
16
- module_contents = 'Version 3'
17
- module_contents_regex = /\A#{module_contents}\n\z/
18
-
19
- module_contents_path = File.join(prod_env_modules_path, 'spotty', 'manifests', 'init.pp')
20
- module_version_filepath = File.join(prod_env_modules_path, 'spotty', 'metadata.json')
21
- module_version_3_regex = /"0.3.0"/
22
-
23
- #File
24
- puppet_file = <<-PUPPETFILE
25
- mod "puppetlabs/spotty"
26
- PUPPETFILE
27
-
28
- puppet_file_path = File.join(git_environments_path, 'Puppetfile')
29
-
30
- #Teardown
31
- teardown do
32
- clean_up_r10k(master, last_commit, git_environments_path)
33
- end
34
-
35
- #Setup
36
- step 'Stub Forge on Master'
37
- stub_forge_on(master)
38
-
39
- #Tests
40
- step 'Checkout "production" Branch'
41
- git_on(master, 'checkout production', git_environments_path)
42
-
43
- step 'Create "Puppetfile" for the "production" Environment'
44
- create_remote_file(master, puppet_file_path, puppet_file)
45
-
46
- step 'Push Changes'
47
- git_add_commit_push(master, 'production', 'Add module.', git_environments_path)
48
-
49
- #Tests
50
- step 'Deploy "production" Environment via r10k with modules'
51
- on(master, "#{r10k_fqp} deploy environment -p -v")
52
-
53
- agents.each do |agent|
54
- step "Run Puppet Agent"
55
- on(agent, puppet('agent', '--test', '--environment production'), :acceptable_exit_codes => [0,2]) do |result|
56
- assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!')
57
- end
58
-
59
- step 'Verify Contents'
60
- on(master, "cat #{module_contents_path}") do |result|
61
- assert_match(module_contents, result.stdout, 'File Content is Invalid')
62
- end
63
-
64
- step 'Verify Version'
65
- on(master, "grep version #{module_version_filepath}") do |result|
66
- assert_match(module_version_3_regex, result.stdout, 'File Content is Invalid')
67
- end
68
- end
@@ -1,13 +0,0 @@
1
- class R10K::Environment::Bare < R10K::Environment::Plain
2
-
3
- R10K::Environment.register(:bare, self)
4
-
5
- def initialize(name, basedir, dirname, options = {})
6
- logger.warn _('"bare" environment type is deprecated; please use "plain" instead (environment: %{name})') % {name: name}
7
- super
8
- end
9
-
10
- def signature
11
- 'bare-default'
12
- end
13
- end
File without changes
@@ -1 +0,0 @@
1
- I am bad JSON!
@@ -1,8 +0,0 @@
1
- name 'branan-eight_hundred'
2
- version '8.0.0'
3
- source 'https://github.com/branan/puppet-module-eight_hundred'
4
- author 'Branan Purvine-Riley'
5
- license 'Apache License 2.0'
6
- summary '800 modules! WOOOOOOO!'
7
- description '800 modules! WOOOOOOOOOOOOOOOOOO!'
8
- project_page 'https://github.com/branan/puppet-module-eight_hundred'
@@ -1,19 +0,0 @@
1
- {
2
- "checksums": {
3
- "Modulefile": "1e780d794bcd6629dc3006129fc02edf"
4
- },
5
- "license": "Apache License 2.0",
6
- "types": [
7
-
8
- ],
9
- "version": "8.0.0",
10
- "dependencies": [
11
-
12
- ],
13
- "summary": "800 modules! WOOOOOOO!",
14
- "source": "https://github.com/branan/puppet-module-eight_hundred",
15
- "description": "800 modules! WOOOOOOOOOOOOOOOOOO!",
16
- "author": "Branan Purvine-Riley",
17
- "name": "branan-eight_hundred",
18
- "project_page": "https://github.com/branan/puppet-module-eight_hundred"
19
- }
Binary file
@@ -1,5 +0,0 @@
1
- ---
2
- cachedir: /config_cachedir
3
- deploy:
4
- generate_types: /config_generate_types
5
- puppet_path: /config_puppet_path
@@ -1,2 +0,0 @@
1
- ---
2
- cachedir: /config_cachedir
@@ -1,9 +0,0 @@
1
- ---
2
- git:
3
- private_key: '/global/config/private/key'
4
- oauth_token: '/global/config/oauth/token'
5
- repositories:
6
- - remote: 'git@myfakegitserver.com:user/repo.git'
7
- private_key: '/config/private/key'
8
- - remote: 'https://myfakegitserver.com/user/repo.git'
9
- oauth_token: '/config/oauth/token'
@@ -1,4 +0,0 @@
1
- ---
2
- forge:
3
- baseurl: 'http://private-forge.com'
4
- authorization_token: 'faketoken'
@@ -1,3 +0,0 @@
1
- ---
2
- forge:
3
- authorization_token: 'faketoken'
@@ -1,3 +0,0 @@
1
- ---
2
- deploy:
3
- generate_types: /config_generate_types
@@ -1,12 +0,0 @@
1
- ---
2
- logging:
3
- level: FATAL
4
-
5
- outputs:
6
- - type: file
7
- parameters:
8
- filename: r10k.log
9
-
10
- - type: syslog
11
-
12
- disable_default_stderr: true
@@ -1,3 +0,0 @@
1
- ---
2
- deploy:
3
- puppet_path: /config_puppet_path
@@ -1 +0,0 @@
1
- mod 'branan/eight_hundred', '1.0.0', :git => 'https://github.com/branan/eight_hundred', :ref => 'master'
@@ -1,5 +0,0 @@
1
- mod 'cd4pe',
2
- :git => 'test@randomurl.com:something/some_module.git',
3
- :ref => 'expected_ref',
4
- :default_branch => 'here_lies_the_default_branch'
5
-
@@ -1,10 +0,0 @@
1
- forge "http://forge.puppetlabs.com"
2
-
3
- mod "puppetlabs/stdlib", '4.11.0'
4
- mod "puppetlabs/stdlib", '4.12.0'
5
- mod "puppetlabs/concat", '2.1.0'
6
- mod "otheruser/concat", '2.1.0'
7
-
8
- mod 'apache',
9
- :git => 'https://github.com/puppetlabs/puppetlabs-apache',
10
- :branch => 'docs_experiment'
@@ -1,8 +0,0 @@
1
- forge "my.custom.forge.com"
2
-
3
- mod "puppetlabs/stdlib", '4.12.0'
4
- mod "puppetlabs/concat", '2.1.0'
5
-
6
- mod 'apache',
7
- :git => 'https://github.com/puppetlabs/puppetlabs-apache',
8
- :branch => 'docs_experiment'
@@ -1 +0,0 @@
1
- mod 'branan/eight_hundred' :git => 'https://github.com/branan/eight_hundred'
@@ -1 +0,0 @@
1
- require 'a-shrubbery!'
@@ -1 +0,0 @@
1
- mod 'branan/eight_hundred', undefined_lookup_function('eight_hundred')
@@ -1 +0,0 @@
1
- mod 'puppetlabs/apt', '2.1.1'
@@ -1 +0,0 @@
1
- mod 'puppetlabs/apt'
@@ -1,10 +0,0 @@
1
- mod 'puppetlabs/apt', '2.1.1'
2
- mod 'puppetlabs/stdlib', :latest
3
- mod 'puppetlabs/concat'
4
- mod 'puppetlabs/rpm', '2.1.1-pre1'
5
- mod 'foo', git: 'this/remote', branch: 'main'
6
- mod 'bar', git: 'this/remote', tag: 'v1.2.3'
7
- mod 'baz', git: 'this/remote', commit: '123abc456'
8
- mod 'fizz', git: 'this/remote', ref: '1234567890abcdef1234567890abcdef12345678'
9
- mod 'buzz', git: 'this/remote', ref: 'refs/heads/main'
10
- mod 'canary', local: true