r10k 3.5.1 → 3.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/.github/pull_request_template.md +4 -1
  3. data/.github/workflows/docker.yml +4 -1
  4. data/.github/workflows/release.yml +3 -2
  5. data/.github/workflows/rspec_tests.yml +81 -0
  6. data/.travis.yml +8 -1
  7. data/CHANGELOG.mkd +43 -2
  8. data/CODEOWNERS +2 -2
  9. data/README.mkd +13 -4
  10. data/doc/common-patterns.mkd +1 -0
  11. data/doc/dynamic-environments/configuration.mkd +143 -39
  12. data/doc/dynamic-environments/usage.mkd +12 -11
  13. data/doc/puppetfile.mkd +23 -3
  14. data/docker/Gemfile +1 -1
  15. data/docker/Makefile +7 -4
  16. data/docker/docker-compose.yml +18 -0
  17. data/docker/r10k/Dockerfile +4 -3
  18. data/docker/r10k/docker-entrypoint.sh +0 -1
  19. data/docker/r10k/release.Dockerfile +3 -2
  20. data/docker/spec/dockerfile_spec.rb +26 -32
  21. data/integration/tests/git_source/git_source_repeated_remote.rb +68 -0
  22. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb +2 -1
  23. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb +2 -1
  24. data/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb +1 -1
  25. data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb +2 -1
  26. data/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb +1 -1
  27. data/integration/tests/user_scenario/complex_workflow/multi_env_remove_re-add.rb +1 -1
  28. data/integration/tests/user_scenario/complex_workflow/multi_env_unamanaged.rb +1 -1
  29. data/lib/r10k/action/deploy/display.rb +9 -3
  30. data/lib/r10k/action/deploy/environment.rb +39 -14
  31. data/lib/r10k/action/deploy/module.rb +4 -1
  32. data/lib/r10k/action/runner.rb +34 -0
  33. data/lib/r10k/cli/deploy.rb +14 -7
  34. data/lib/r10k/cli/puppetfile.rb +5 -5
  35. data/lib/r10k/environment/base.rb +9 -2
  36. data/lib/r10k/environment/git.rb +17 -2
  37. data/lib/r10k/environment/name.rb +22 -4
  38. data/lib/r10k/environment/svn.rb +11 -2
  39. data/lib/r10k/environment/with_modules.rb +28 -20
  40. data/lib/r10k/forge/module_release.rb +2 -2
  41. data/lib/r10k/git.rb +1 -0
  42. data/lib/r10k/git/cache.rb +12 -4
  43. data/lib/r10k/git/rugged/credentials.rb +39 -2
  44. data/lib/r10k/git/stateful_repository.rb +4 -0
  45. data/lib/r10k/initializers.rb +2 -0
  46. data/lib/r10k/module/base.rb +8 -0
  47. data/lib/r10k/module/forge.rb +16 -4
  48. data/lib/r10k/module/git.rb +42 -24
  49. data/lib/r10k/module/local.rb +1 -1
  50. data/lib/r10k/module/svn.rb +14 -11
  51. data/lib/r10k/puppetfile.rb +30 -12
  52. data/lib/r10k/settings.rb +30 -3
  53. data/lib/r10k/source/base.rb +5 -0
  54. data/lib/r10k/source/git.rb +26 -3
  55. data/lib/r10k/source/hash.rb +4 -2
  56. data/lib/r10k/source/svn.rb +5 -1
  57. data/lib/r10k/util/setopts.rb +33 -12
  58. data/lib/r10k/version.rb +1 -1
  59. data/locales/r10k.pot +71 -43
  60. data/r10k.gemspec +1 -1
  61. data/spec/fixtures/unit/action/r10k_creds.yaml +9 -0
  62. data/spec/shared-examples/subprocess-runner.rb +11 -5
  63. data/spec/unit/action/deploy/display_spec.rb +4 -0
  64. data/spec/unit/action/deploy/environment_spec.rb +154 -12
  65. data/spec/unit/action/deploy/module_spec.rb +40 -1
  66. data/spec/unit/action/puppetfile/install_spec.rb +1 -0
  67. data/spec/unit/action/runner_spec.rb +48 -1
  68. data/spec/unit/environment/git_spec.rb +19 -2
  69. data/spec/unit/environment/name_spec.rb +28 -0
  70. data/spec/unit/environment/svn_spec.rb +12 -0
  71. data/spec/unit/environment/with_modules_spec.rb +74 -0
  72. data/spec/unit/forge/module_release_spec.rb +14 -10
  73. data/spec/unit/git/cache_spec.rb +10 -0
  74. data/spec/unit/git/rugged/credentials_spec.rb +79 -2
  75. data/spec/unit/git_spec.rb +3 -3
  76. data/spec/unit/module/forge_spec.rb +6 -0
  77. data/spec/unit/module/git_spec.rb +56 -1
  78. data/spec/unit/module_spec.rb +59 -9
  79. data/spec/unit/puppetfile_spec.rb +61 -7
  80. data/spec/unit/settings_spec.rb +12 -0
  81. data/spec/unit/source/git_spec.rb +49 -1
  82. data/spec/unit/util/setopts_spec.rb +25 -1
  83. metadata +9 -11
  84. data/azure-pipelines.yml +0 -86
@@ -18,16 +18,16 @@ Command line invocation
18
18
 
19
19
  Recursively update all environments:
20
20
 
21
- r10k deploy environment --puppetfile
21
+ r10k deploy environment --modules
22
22
 
23
23
  The simplest way to use r10k is by simply updating all environments and modules
24
24
  and takes the brute force approach of "update everything, ever." When this
25
25
  command is run r10k will update all sources, create new environments and delete
26
26
  old environments, and recursively update all environment modules specified in
27
- environment Puppetfiles. While this is the simplest method for running r10k, is
28
- is also the slowest by a very large degree because it does the maximum possible
29
- work. This should not be something you run interactively, or use on a regular
30
- basis.
27
+ environment Puppetfiles, yamldirs, etc. While this is the simplest method for
28
+ running r10k, it is also the slowest by a very large degree because it does the
29
+ maximum possible work. This should not be something you run interactively, or
30
+ use on a regular basis.
31
31
 
32
32
  - - -
33
33
 
@@ -55,7 +55,7 @@ only the environment itself will be updated.
55
55
 
56
56
  Update a single environment and force an update of modules:
57
57
 
58
- r10k deploy environment my_working_environment --puppetfile
58
+ r10k deploy environment my_working_environment --modules
59
59
 
60
60
  This will update the given environment and update all contained modules. This is
61
61
  useful if you want to make sure that a given environment is fully up to date.
@@ -64,13 +64,14 @@ useful if you want to make sure that a given environment is fully up to date.
64
64
 
65
65
  Update a single environment and specify a default branch override:
66
66
 
67
- r10k deploy environment my_working_environment --puppetfile --default-branch-override default_branch_override
67
+ r10k deploy environment my_working_environment --modules --default-branch-override default_branch_override
68
68
 
69
- This will update the given environment and update all contained modules, overrideing
70
- the :default_branch entry in the Puppetfile of each module. This is used primarily to allow
69
+ This will update the given environment and update all contained modules, overriding
70
+ the :default_branch entry in the Puppetfile of each module. If the specified override branch is not
71
+ found, it will fall back to the normal default branch and attempt to use that. This is used primarily to allow
71
72
  automated r10k solutions using the control_branch pattern with a temporary branch deployment to
72
- ensure the deployment is pushed to the correct module repository branch. Note that the :default_branch
73
- is only ever utilized if the desired ref cannot be located.
73
+ ensure the deployment is pushed to the correct module repository branch. Note that the :default_branch and its
74
+ override are only ever used if the specific desired ref cannot be located.
74
75
 
75
76
  ### Deploying modules
76
77
 
data/doc/puppetfile.mkd CHANGED
@@ -109,11 +109,19 @@ latest version available.
109
109
 
110
110
  mod 'puppetlabs/apache', :latest
111
111
 
112
+ An explicit type and/or version can be specified using the standard interface,
113
+ `:type` and `:version`. The `:source` parameter is not supported for individual
114
+ forge modules and will be ignored.
115
+
116
+ mod 'puppetlabs/apache',
117
+ type: 'forge',
118
+ version: '6.0.0'
119
+
112
120
  ### Git
113
121
 
114
122
  Git repositories that contain a Puppet module can be cloned and used as modules.
115
123
  When Git is used, the module version can be specified by using `:ref`, `:tag`,
116
- `:commit`, and `:branch`.
124
+ `:commit`, `:branch`, or the standard interface parameter `:version`.
117
125
 
118
126
  When a module is installed using `:ref`, r10k uses some simple heuristics to
119
127
  determine the type of Git object that should be checked out. This can be used
@@ -153,6 +161,13 @@ mod 'apache',
153
161
  mod 'apache',
154
162
  :git => 'https://github.com/puppetlabs/puppetlabs-apache',
155
163
  :branch => 'docs_experiment'
164
+
165
+ # Install puppetlabs/apache and use standard interface parameters pinned to the
166
+ # '2098a17' commit.
167
+ mod 'puppetlabs-apache',
168
+ type: 'git',
169
+ source: 'https://github.com/puppetlabs/puppetlabs-apache',
170
+ version: '2098a17'
156
171
  ```
157
172
 
158
173
  #### Control Repo Branch Tracking
@@ -195,8 +210,8 @@ the latest version available in the main SVN repository.
195
210
  mod 'apache',
196
211
  :svn => 'https://github.com/puppetlabs/puppetlabs-apache/trunk'
197
212
 
198
- If an SVN revision number is specified with `:rev` (or `:revision`), that
199
- SVN revision will be kept checked out.
213
+ If an SVN revision number is specified with `:rev`, `:revision`, or `:version`,
214
+ that SVN revision will be kept checked out.
200
215
 
201
216
  mod 'apache',
202
217
  :svn => 'https://github.com/puppetlabs/puppetlabs-apache/trunk',
@@ -206,6 +221,11 @@ SVN revision will be kept checked out.
206
221
  :svn => 'https://github.com/puppetlabs/puppetlabs-apache/trunk',
207
222
  :revision => '154'
208
223
 
224
+ mod 'apache',
225
+ type: 'svn',
226
+ source: 'https://github.com/puppetlabs/puppetlabs-apache/trunk',
227
+ version: '154'
228
+
209
229
  If the SVN repository requires credentials, you can supply the `:username` and
210
230
  `:password` options.
211
231
 
data/docker/Gemfile CHANGED
@@ -2,7 +2,7 @@ source "https://rubygems.org"
2
2
 
3
3
  gem 'pupperware',
4
4
  :git => 'https://github.com/puppetlabs/pupperware.git',
5
- :branch => 'master',
5
+ :branch => 'main',
6
6
  :glob => 'gem/*.gemspec'
7
7
 
8
8
  group :test do
data/docker/Makefile CHANGED
@@ -5,11 +5,12 @@ vcs_ref := $(shell git rev-parse HEAD)
5
5
  build_date := $(shell date -u +%FT%T)
6
6
  hadolint_available := $(shell hadolint --help > /dev/null 2>&1; echo $$?)
7
7
  hadolint_command := hadolint
8
- hadolint_container := hadolint/hadolint:latest
8
+ hadolint_container := ghcr.io/hadolint/hadolint:latest
9
+ alpine_version := 3.9
9
10
  export BUNDLE_PATH = $(PWD)/.bundle/gems
10
11
  export BUNDLE_BIN = $(PWD)/.bundle/bin
11
12
  export GEMFILE = $(PWD)/Gemfile
12
- export DOCKER_BUILDKIT = 1
13
+ export DOCKER_BUILDKIT ?= 1
13
14
 
14
15
  ifeq ($(IS_RELEASE),true)
15
16
  VERSION ?= $(shell echo $(git_describe) | sed 's/-.*//')
@@ -48,9 +49,11 @@ else
48
49
  endif
49
50
 
50
51
  build: prep
51
- docker build \
52
+ docker pull alpine:$(alpine_version)
53
+ docker buildx build \
52
54
  ${DOCKER_BUILD_FLAGS} \
53
- --pull \
55
+ --load \
56
+ --build-arg alpine_version=$(alpine_version) \
54
57
  --build-arg vcs_ref=$(vcs_ref) \
55
58
  --build-arg build_date=$(build_date) \
56
59
  --build-arg version=$(VERSION) \
@@ -0,0 +1,18 @@
1
+ version: '3.7'
2
+
3
+ services:
4
+ r10k_check:
5
+ image: ${R10K_IMAGE:-puppet/r10k}
6
+ environment:
7
+ - PUPPERWARE_ANALYTICS_ENABLED=${PUPPERWARE_ANALYTICS_ENABLED:-false}
8
+ command: 'puppetfile check --verbose --trace --puppetfile test/Puppetfile'
9
+ volumes:
10
+ - ${SPEC_DIRECTORY}/fixtures:/home/puppet/test
11
+
12
+ r10k_install:
13
+ image: ${R10K_IMAGE:-puppet/r10k}
14
+ environment:
15
+ - PUPPERWARE_ANALYTICS_ENABLED=${PUPPERWARE_ANALYTICS_ENABLED:-false}
16
+ command: 'puppetfile install --verbose --trace --puppetfile test/Puppetfile'
17
+ volumes:
18
+ - ${SPEC_DIRECTORY}/fixtures:/home/puppet/test
@@ -1,4 +1,5 @@
1
- FROM alpine:3.9 as build
1
+ ARG alpine_version=3.9
2
+ FROM alpine:${alpine_version} as build
2
3
 
3
4
  # hadolint ignore=DL3018
4
5
  RUN apk add --no-cache ruby git && \
@@ -8,7 +9,7 @@ COPY . /workspace
8
9
  RUN gem build r10k.gemspec && \
9
10
  mv r10k*.gem r10k.gem
10
11
 
11
- FROM alpine:3.9
12
+ FROM alpine:${alpine_version}
12
13
 
13
14
  ARG vcs_ref
14
15
  ARG build_date
@@ -48,7 +49,7 @@ COPY --from=build /workspace/r10k.gem /
48
49
  SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
49
50
  # ignore apk and gem pinning
50
51
  # hadolint ignore=DL3018,DL3028
51
- RUN chmod a+x /adduser.sh /docker-entrypoint.sh && \
52
+ RUN chmod a+x /adduser.sh /docker-entrypoint.sh /docker-entrypoint.d/*.sh && \
52
53
  # Add a puppet user to run r10k as for consistency with puppetserver
53
54
  /adduser.sh && \
54
55
  chown -R puppet: /docker-entrypoint.d /docker-entrypoint.sh && \
@@ -4,7 +4,6 @@ set -e
4
4
 
5
5
  for f in /docker-entrypoint.d/*.sh; do
6
6
  # Don't print out any messages here since this is a CLI container
7
- chmod +x "$f"
8
7
  "$f"
9
8
  done
10
9
 
@@ -1,4 +1,5 @@
1
- FROM alpine:3.9
1
+ ARG alpine_version=3.9
2
+ FROM alpine:${alpine_version}
2
3
 
3
4
  ARG vcs_ref
4
5
  ARG build_date
@@ -37,7 +38,7 @@ LABEL org.label-schema.version="$version" \
37
38
  SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
38
39
  # ignore apk and gem pinning
39
40
  # hadolint ignore=DL3018,DL3028
40
- RUN chmod a+x /adduser.sh /docker-entrypoint.sh && \
41
+ RUN chmod a+x /adduser.sh /docker-entrypoint.sh /docker-entrypoint.d/*.sh && \
41
42
  /adduser.sh && \
42
43
  chown -R puppet: /docker-entrypoint.d /docker-entrypoint.sh && \
43
44
  apk add --no-cache ruby openssh-client git ruby-rugged curl ruby-dev make gcc musl-dev && \
@@ -1,43 +1,37 @@
1
1
  require 'rspec/core'
2
2
  require 'fileutils'
3
3
  require 'open3'
4
+ include Pupperware::SpecHelpers
4
5
 
5
- SPEC_DIRECTORY = File.dirname(__FILE__)
6
+ ENV['SPEC_DIRECTORY'] = File.dirname(__FILE__)
7
+ # unifies volume naming
8
+ ENV['COMPOSE_PROJECT_NAME'] ||= 'r10k'
6
9
 
7
- describe 'r10k container' do
8
- include Pupperware::SpecHelpers
9
- def run_r10k(command)
10
- run_command("docker run --detach \
11
- --volume #{File.join(SPEC_DIRECTORY, 'fixtures')}:/home/puppet/test \
12
- #{@image} #{command} \
13
- --verbose \
14
- --trace \
15
- --puppetfile test/Puppetfile")
16
- end
17
-
18
- before(:all) do
19
- @image = require_test_image
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)
20
17
  end
21
18
 
22
- after(:all) do
23
- FileUtils.rm_rf(File.join(SPEC_DIRECTORY, 'fixtures', 'modules'))
24
- end
25
-
26
- it 'should validate the Puppetfile' do
27
- result = run_r10k('puppetfile check')
28
- container = result[:stdout].chomp
29
- wait_on_container_exit(container)
30
- expect(get_container_exit_code(container)).to eq(0)
31
- emit_log(container)
32
- teardown_container(container)
19
+ c.after(:suite) do
20
+ teardown_cluster()
21
+ FileUtils.rm_rf(File.join(ENV['SPEC_DIRECTORY'], 'fixtures', 'modules'))
33
22
  end
23
+ end
34
24
 
35
- it 'should install the Puppetfile' do
36
- result = run_r10k('puppetfile install')
37
- container = result[:stdout].chomp
38
- wait_on_container_exit(container)
39
- expect(get_container_exit_code(container)).to eq(0)
40
- emit_log(container)
41
- teardown_container(container)
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
42
36
  end
43
37
  end
@@ -0,0 +1,68 @@
1
+ require 'git_utils'
2
+ require 'r10k_utils'
3
+ require 'master_manipulator'
4
+ test_name 'Verify the same remote can be used in more than one object'
5
+
6
+ env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
7
+ r10k_fqp = get_r10k_fqp(master)
8
+ git_environments_path = '/root/environments'
9
+ git_repo_path = '/git_repos'
10
+ git_repo_name = 'environments'
11
+ git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git")
12
+ code_dir = "#{env_path}/production"
13
+
14
+ last_commit = git_last_commit(master, git_environments_path)
15
+ git_provider = ENV['GIT_PROVIDER']
16
+ r10k_config_path = get_r10k_config_file_path(master)
17
+ r10k_config_bak_path = "#{r10k_config_path}.bak"
18
+ #In-line files
19
+ r10k_conf = <<-CONF
20
+ cachedir: '/var/cache/r10k'
21
+ git:
22
+ provider: '#{git_provider}'
23
+ sources:
24
+ control:
25
+ basedir: "#{env_path}"
26
+ remote: "#{git_control_remote}"
27
+ CONF
28
+
29
+ # Install the same module in two different places
30
+ puppetfile = <<-EOS
31
+ mod 'prod_apache',
32
+ :git => 'git://github.com/puppetlabs/puppetlabs-apache.git',
33
+ :tag => 'v6.0.0'
34
+
35
+ mod 'test_apache',
36
+ :git => 'git://github.com/puppetlabs/puppetlabs-apache.git',
37
+ :tag => 'v6.0.0'
38
+ EOS
39
+
40
+ teardown do
41
+ step 'Restore Original "r10k" Config'
42
+ on(master, "mv #{r10k_config_bak_path} #{r10k_config_path}")
43
+
44
+ clean_up_r10k(master, last_commit, git_environments_path)
45
+ end
46
+
47
+ step 'Stub the forge'
48
+ stub_forge_on(master)
49
+
50
+ step 'Backup Current "r10k" Config'
51
+ on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
52
+
53
+ step 'Update the "r10k" Config'
54
+ create_remote_file(master, r10k_config_path, r10k_conf)
55
+
56
+ step 'Ask r10k to deploy'
57
+ on(master, "#{r10k_fqp} deploy environment -p")
58
+
59
+ step 'Add puppetfile with repeated remote'
60
+ create_remote_file(master, "#{git_environments_path}/Puppetfile", puppetfile)
61
+ git_add_commit_push(master, 'production', 'add Puppetfile', git_environments_path)
62
+
63
+ step 'Deploy r10k'
64
+ on(master, "#{r10k_fqp} deploy environment -p")
65
+
66
+ step 'Verify module was installed in both places'
67
+ on(master, "test -d #{code_dir}/modules/prod_apache")
68
+ on(master, "test -d #{code_dir}/modules/test_apache")
@@ -27,7 +27,8 @@ 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 => 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
30
+ :git => 'git://github.com/puppetlabs/puppetlabs-stdlib.git',
31
+ :tag => 'v7.0.1'
31
32
  PUPPETFILE
32
33
 
33
34
  puppet_file_path = File.join(git_environments_path, 'Puppetfile')
@@ -31,7 +31,8 @@ puppet_file = <<-PUPPETFILE
31
31
  moduledir '#{@module_path}'
32
32
  mod "puppetlabs/motd"
33
33
  mod 'puppetlabs/stdlib',
34
- :git => 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
34
+ :git => 'git://github.com/puppetlabs/puppetlabs-stdlib.git',
35
+ :tag => 'v7.0.1'
35
36
  PUPPETFILE
36
37
 
37
38
  puppet_file_path = File.join(git_environments_path, 'Puppetfile')
@@ -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 => "git://github.com/puppetlabs/puppetlabs-stdlib.git"',
68
+ 'mod "puppetlabs/stdlib", :git => "git://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
  ),
@@ -28,7 +28,8 @@ 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 => 'git://github.com/puppetlabs/puppetlabs-inifile'
31
+ :git => 'git://github.com/puppetlabs/puppetlabs-inifile',
32
+ :tag => 'v5.0.1'
32
33
  PUPPETFILE
33
34
 
34
35
  puppet_file_path = File.join(git_environments_path, 'Puppetfile')
@@ -24,7 +24,7 @@ stage_env_notify_message = 'This is a different message'
24
24
  stage_env_notify_message_regex = /#{stage_env_notify_message}/
25
25
 
26
26
  #Verification for "test" Environment
27
- test_env_error_message_regex = /Error:.*Could not find environment 'test'/
27
+ test_env_error_message_regex = /Error:.*Could not.*environment '?test'?/
28
28
 
29
29
  #Verification for "temp" Environment
30
30
  test_env_notify_message_regex = /I am in the temp environment/
@@ -15,7 +15,7 @@ initial_env_names = ['production', 'stage']
15
15
 
16
16
  #Verification
17
17
  notify_message_regex = /I am in the production environment/
18
- stage_env_error_message_regex = /Error:.*Could not find environment 'stage'/
18
+ stage_env_error_message_regex = /Error:.*Could not.*environment '?stage'?/
19
19
 
20
20
  #Manifest
21
21
  site_pp_path = File.join(git_environments_path, 'manifests', 'site.pp')
@@ -22,7 +22,7 @@ site_pp = create_site_pp(master_certname, ' include helloworld')
22
22
  notify_message_prod_env_regex = /I am in the production environment/
23
23
  notify_message_test_env_regex = /I am in the test environment/
24
24
  removal_message_test_env_regex = /Removing unmanaged path.*test/
25
- error_message_regex = /Could not retrieve catalog from remote server/
25
+ error_message_regex = /Could not retrieve (catalog from remote server|information from environment test)/
26
26
 
27
27
  #Teardown
28
28
  teardown do
@@ -59,14 +59,14 @@ module R10K
59
59
  end
60
60
 
61
61
  def environment_info(env)
62
- if !@puppetfile && !@detail
62
+ if !@modules && !@detail
63
63
  env.dirname
64
64
  else
65
65
  env_info = env.info.merge({
66
66
  :status => (env.status rescue nil),
67
67
  })
68
68
 
69
- env_info[:modules] = env.modules.map { |mod| module_info(mod) } if @puppetfile
69
+ env_info[:modules] = env.modules.map { |mod| module_info(mod) } if @modules
70
70
 
71
71
  env_info
72
72
  end
@@ -81,7 +81,13 @@ module R10K
81
81
  end
82
82
 
83
83
  def allowed_initialize_opts
84
- super.merge(puppetfile: :self, detail: :self, format: :self, fetch: :self)
84
+ super.merge({
85
+ puppetfile: :modules,
86
+ modules: :self,
87
+ detail: :self,
88
+ format: :self,
89
+ fetch: :self
90
+ })
85
91
  end
86
92
  end
87
93
  end