r10k 3.5.2 → 3.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/pull_request_template.md +4 -1
- data/.github/workflows/docker.yml +4 -1
- data/.github/workflows/release.yml +3 -2
- data/.github/workflows/rspec_tests.yml +81 -0
- data/.github/workflows/stale.yml +19 -0
- data/.travis.yml +8 -1
- data/CHANGELOG.mkd +43 -1
- data/CODEOWNERS +2 -2
- data/README.mkd +13 -4
- data/doc/common-patterns.mkd +1 -0
- data/doc/dynamic-environments/configuration.mkd +149 -45
- data/doc/dynamic-environments/usage.mkd +12 -11
- data/doc/puppetfile.mkd +23 -3
- data/docker/Gemfile +1 -1
- data/docker/Makefile +7 -4
- data/docker/docker-compose.yml +18 -0
- data/docker/r10k/Dockerfile +4 -3
- data/docker/r10k/docker-entrypoint.sh +0 -1
- data/docker/r10k/release.Dockerfile +3 -2
- data/docker/spec/dockerfile_spec.rb +26 -32
- data/integration/tests/git_source/git_source_repeated_remote.rb +68 -0
- data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb +1 -1
- data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb +2 -1
- data/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb +1 -1
- data/integration/tests/user_scenario/complex_workflow/multi_env_remove_re-add.rb +1 -1
- data/integration/tests/user_scenario/complex_workflow/multi_env_unamanaged.rb +1 -1
- data/lib/r10k/action/base.rb +8 -1
- data/lib/r10k/action/deploy/display.rb +46 -10
- data/lib/r10k/action/deploy/environment.rb +98 -50
- data/lib/r10k/action/deploy/module.rb +51 -29
- data/lib/r10k/action/puppetfile/check.rb +3 -1
- data/lib/r10k/action/puppetfile/install.rb +20 -23
- data/lib/r10k/action/puppetfile/purge.rb +8 -2
- data/lib/r10k/action/runner.rb +34 -0
- data/lib/r10k/cli/deploy.rb +14 -7
- data/lib/r10k/cli/puppetfile.rb +5 -5
- data/lib/r10k/content_synchronizer.rb +83 -0
- data/lib/r10k/deployment.rb +1 -1
- data/lib/r10k/environment/base.rb +30 -3
- data/lib/r10k/environment/git.rb +17 -5
- data/lib/r10k/environment/name.rb +22 -4
- data/lib/r10k/environment/svn.rb +11 -4
- data/lib/r10k/environment/with_modules.rb +46 -30
- data/lib/r10k/git.rb +1 -0
- data/lib/r10k/git/cache.rb +12 -4
- data/lib/r10k/git/rugged/credentials.rb +39 -2
- data/lib/r10k/git/stateful_repository.rb +4 -0
- data/lib/r10k/initializers.rb +2 -0
- data/lib/r10k/module.rb +1 -1
- data/lib/r10k/module/base.rb +25 -1
- data/lib/r10k/module/forge.rb +29 -11
- data/lib/r10k/module/git.rb +54 -27
- data/lib/r10k/module/local.rb +2 -1
- data/lib/r10k/module/svn.rb +24 -18
- data/lib/r10k/puppetfile.rb +75 -72
- data/lib/r10k/settings.rb +30 -3
- data/lib/r10k/source/base.rb +9 -0
- data/lib/r10k/source/git.rb +40 -9
- data/lib/r10k/source/hash.rb +5 -5
- data/lib/r10k/source/svn.rb +5 -3
- data/lib/r10k/util/cleaner.rb +21 -0
- data/lib/r10k/util/setopts.rb +33 -12
- data/lib/r10k/version.rb +1 -1
- data/locales/r10k.pot +103 -83
- data/r10k.gemspec +1 -1
- data/spec/fixtures/unit/action/r10k_creds.yaml +9 -0
- data/spec/r10k-mocks/mock_source.rb +1 -1
- data/spec/shared-examples/puppetfile-action.rb +7 -7
- data/spec/shared-examples/subprocess-runner.rb +11 -5
- data/spec/unit/action/deploy/display_spec.rb +35 -5
- data/spec/unit/action/deploy/environment_spec.rb +207 -37
- data/spec/unit/action/deploy/module_spec.rb +173 -26
- data/spec/unit/action/puppetfile/check_spec.rb +2 -2
- data/spec/unit/action/puppetfile/install_spec.rb +32 -10
- data/spec/unit/action/puppetfile/purge_spec.rb +25 -5
- data/spec/unit/action/runner_spec.rb +48 -1
- data/spec/unit/environment/git_spec.rb +19 -2
- data/spec/unit/environment/name_spec.rb +28 -0
- data/spec/unit/environment/svn_spec.rb +12 -0
- data/spec/unit/environment/with_modules_spec.rb +74 -0
- data/spec/unit/git/cache_spec.rb +10 -0
- data/spec/unit/git/rugged/credentials_spec.rb +79 -2
- data/spec/unit/git_spec.rb +3 -3
- data/spec/unit/module/forge_spec.rb +21 -13
- data/spec/unit/module/git_spec.rb +64 -1
- data/spec/unit/module_spec.rb +60 -10
- data/spec/unit/puppetfile_spec.rb +98 -30
- data/spec/unit/settings_spec.rb +12 -0
- data/spec/unit/source/git_spec.rb +49 -1
- data/spec/unit/util/purgeable_spec.rb +2 -8
- data/spec/unit/util/setopts_spec.rb +25 -1
- metadata +12 -11
- 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 --
|
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
|
28
|
-
is also the slowest by a very large degree because it does the
|
29
|
-
work. This should not be something you run interactively, or
|
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 --
|
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 --
|
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,
|
70
|
-
the :default_branch entry in the Puppetfile of each module.
|
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
|
-
|
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`,
|
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
|
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
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
|
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
|
52
|
+
docker pull alpine:$(alpine_version)
|
53
|
+
docker buildx build \
|
52
54
|
${DOCKER_BUILD_FLAGS} \
|
53
|
-
--
|
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
|
data/docker/r10k/Dockerfile
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
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
|
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 && \
|
@@ -1,4 +1,5 @@
|
|
1
|
-
|
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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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(:
|
23
|
-
|
24
|
-
|
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
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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')
|
data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb
CHANGED
@@ -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
|
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
|
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
|
data/lib/r10k/action/base.rb
CHANGED
@@ -10,7 +10,14 @@ module R10K
|
|
10
10
|
|
11
11
|
attr_accessor :settings
|
12
12
|
|
13
|
-
|
13
|
+
# @param opts [Hash] A hash of options defined in #allowed_initialized_opts
|
14
|
+
# and managed by the SetOps mixin within the Action::Base class.
|
15
|
+
# Corresponds to the CLI flags and options.
|
16
|
+
# @param argv [CRI::ArgumentList] A list-like collection of the remaining
|
17
|
+
# arguments to the CLI invocation (after removing flags and options).
|
18
|
+
# @param settings [Hash] A hash of configuration loaded from the relevant
|
19
|
+
# config (r10k.yaml).
|
20
|
+
def initialize(opts, argv, settings)
|
14
21
|
@opts = opts
|
15
22
|
@argv = argv
|
16
23
|
@settings = settings
|