r10k 3.5.0 → 3.8.0
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 +25 -1
- data/.github/workflows/rspec_tests.yml +81 -0
- data/.travis.yml +14 -11
- data/CHANGELOG.mkd +42 -6
- data/CODEOWNERS +1 -1
- data/Gemfile +1 -1
- data/README.mkd +13 -4
- data/azure-pipelines.yml +2 -1
- data/doc/dynamic-environments/configuration.mkd +60 -3
- data/doc/dynamic-environments/usage.mkd +5 -4
- data/doc/faq.mkd +6 -1
- data/doc/puppetfile.mkd +2 -0
- data/docker/Makefile +16 -2
- data/docker/r10k/Dockerfile +17 -6
- data/docker/r10k/release.Dockerfile +23 -4
- data/integration/tests/git_source/git_source_repeated_remote.rb +68 -0
- 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/deploy/environment.rb +3 -0
- data/lib/r10k/action/deploy/module.rb +4 -1
- data/lib/r10k/action/runner.rb +34 -0
- data/lib/r10k/cli/deploy.rb +9 -4
- data/lib/r10k/cli/puppetfile.rb +5 -5
- data/lib/r10k/environment/base.rb +8 -1
- data/lib/r10k/environment/with_modules.rb +27 -19
- data/lib/r10k/forge/module_release.rb +2 -2
- data/lib/r10k/git.rb +1 -0
- data/lib/r10k/git/cache.rb +12 -4
- data/lib/r10k/git/rugged/credentials.rb +32 -2
- data/lib/r10k/git/stateful_repository.rb +4 -0
- data/lib/r10k/initializers.rb +2 -0
- data/lib/r10k/module/base.rb +8 -0
- data/lib/r10k/module/forge.rb +1 -1
- data/lib/r10k/module/git.rb +20 -3
- data/lib/r10k/puppetfile.rb +30 -12
- data/lib/r10k/settings.rb +24 -2
- data/lib/r10k/source/git.rb +22 -2
- data/lib/r10k/version.rb +1 -1
- data/locales/r10k.pot +60 -36
- data/spec/fixtures/unit/action/r10k_creds.yaml +9 -0
- data/spec/shared-examples/subprocess-runner.rb +11 -5
- data/spec/unit/action/deploy/environment_spec.rb +43 -2
- data/spec/unit/action/deploy/module_spec.rb +40 -1
- data/spec/unit/action/puppetfile/install_spec.rb +1 -0
- data/spec/unit/action/runner_spec.rb +48 -1
- data/spec/unit/environment/git_spec.rb +3 -2
- data/spec/unit/environment/with_modules_spec.rb +74 -0
- data/spec/unit/forge/module_release_spec.rb +14 -10
- data/spec/unit/git/cache_spec.rb +10 -0
- data/spec/unit/git/rugged/credentials_spec.rb +69 -2
- data/spec/unit/git_spec.rb +3 -3
- data/spec/unit/module/git_spec.rb +55 -0
- data/spec/unit/puppetfile_spec.rb +61 -7
- data/spec/unit/settings_spec.rb +12 -0
- data/spec/unit/source/git_spec.rb +49 -1
- metadata +6 -2
data/doc/faq.mkd
CHANGED
@@ -141,7 +141,7 @@ modulepath = modules:external-modules
|
|
141
141
|
|
142
142
|
Lastly, you can simply move your locally versioned modules to a separate
|
143
143
|
directory to avoid conflicting over the `/modules` directory entirely. With this
|
144
|
-
example as well you can use the `environment.conf file to tell Puppet which
|
144
|
+
example as well you can use the `environment.conf` file to tell Puppet which
|
145
145
|
directories contain modules.
|
146
146
|
|
147
147
|
```
|
@@ -149,6 +149,11 @@ directories contain modules.
|
|
149
149
|
modulepath = internal-modules:modules
|
150
150
|
```
|
151
151
|
|
152
|
+
#### Does R10K support Local/Private Forge?
|
153
|
+
|
154
|
+
Yes. Set the Forge to use _globally_ in `r10k.yaml`. see [Configuration](/doc/dynamic-environments/configuration.mkd#baseurl) for details.
|
155
|
+
|
156
|
+
|
152
157
|
#### What does the name mean?
|
153
158
|
|
154
159
|
It’s called R10K because I’m terrible at names. When I started working on R10K
|
data/doc/puppetfile.mkd
CHANGED
@@ -54,6 +54,8 @@ The `forge` setting specifies which server that Forge based modules are fetched
|
|
54
54
|
from. This is currently a noop and is provided for compatibility with
|
55
55
|
librarian-puppet.
|
56
56
|
|
57
|
+
R10k supports setting the Forge to use _globally_ in `r10k.yaml`. see [Configuration](/doc/dynamic-environments/configuration.mkd#baseurl) for details.
|
58
|
+
|
57
59
|
### moduledir
|
58
60
|
|
59
61
|
The `moduledir` setting specifies where modules from the Puppetfile will be
|
data/docker/Makefile
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
PUPPERWARE_ANALYTICS_STREAM ?= dev
|
2
2
|
NAMESPACE ?= puppet
|
3
|
-
git_describe = $(shell git describe)
|
3
|
+
git_describe = $(shell git describe --tags)
|
4
4
|
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
8
|
hadolint_container := 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
|
@@ -13,6 +14,14 @@ export DOCKER_BUILDKIT = 1
|
|
13
14
|
|
14
15
|
ifeq ($(IS_RELEASE),true)
|
15
16
|
VERSION ?= $(shell echo $(git_describe) | sed 's/-.*//')
|
17
|
+
PUBLISHED_VERSION ?= $(shell curl --silent 'https://rubygems.org/api/v1/gems/r10k.json' | jq '."version"' | tr -d '"')
|
18
|
+
CONTAINER_EXISTS = $(shell DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect $(NAMESPACE)/r10k:$(VERSION) > /dev/null 2>&1; echo $$?)
|
19
|
+
ifeq ($(CONTAINER_EXISTS),0)
|
20
|
+
SKIP_BUILD ?= true
|
21
|
+
else ifneq ($(VERSION),$(PUBLISHED_VERSION))
|
22
|
+
SKIP_BUILD ?= true
|
23
|
+
endif
|
24
|
+
|
16
25
|
LATEST_VERSION ?= latest
|
17
26
|
dockerfile := release.Dockerfile
|
18
27
|
dockerfile_context := r10k
|
@@ -26,6 +35,10 @@ endif
|
|
26
35
|
prep:
|
27
36
|
@git fetch --unshallow 2> /dev/null ||:
|
28
37
|
@git fetch origin 'refs/tags/*:refs/tags/*'
|
38
|
+
ifeq ($(SKIP_BUILD),true)
|
39
|
+
@echo "SKIP_BUILD is true, exiting with 1"
|
40
|
+
@exit 1
|
41
|
+
endif
|
29
42
|
|
30
43
|
lint:
|
31
44
|
ifeq ($(hadolint_available),0)
|
@@ -36,9 +49,10 @@ else
|
|
36
49
|
endif
|
37
50
|
|
38
51
|
build: prep
|
52
|
+
docker pull alpine:$(alpine_version)
|
39
53
|
docker build \
|
40
54
|
${DOCKER_BUILD_FLAGS} \
|
41
|
-
--
|
55
|
+
--build-arg alpine_version=$(alpine_version) \
|
42
56
|
--build-arg vcs_ref=$(vcs_ref) \
|
43
57
|
--build-arg build_date=$(build_date) \
|
44
58
|
--build-arg version=$(VERSION) \
|
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
|
@@ -16,6 +17,11 @@ ARG version="3.1.0"
|
|
16
17
|
# Used by entrypoint to submit metrics to Google Analytics.
|
17
18
|
# Published images should use "production" for this build_arg.
|
18
19
|
ARG pupperware_analytics_stream="dev"
|
20
|
+
# required to schedule runs of "r10k" in K8s
|
21
|
+
ARG supercronic_version="0.1.9"
|
22
|
+
ARG supercronic_sha1sum="5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85"
|
23
|
+
ARG supercronic="supercronic-linux-amd64"
|
24
|
+
ARG supercronic_url="https://github.com/aptible/supercronic/releases/download/v$supercronic_version/$supercronic"
|
19
25
|
|
20
26
|
LABEL org.label-schema.maintainer="Puppet Release Team <release@puppet.com>" \
|
21
27
|
org.label-schema.vendor="Puppet" \
|
@@ -32,7 +38,7 @@ COPY docker/r10k/docker-entrypoint.d /docker-entrypoint.d
|
|
32
38
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
33
39
|
CMD ["help"]
|
34
40
|
|
35
|
-
#
|
41
|
+
# dynamic LABELs and ENV vars placed lower for the sake of Docker layer caching
|
36
42
|
ENV PUPPERWARE_ANALYTICS_STREAM="$pupperware_analytics_stream"
|
37
43
|
|
38
44
|
LABEL org.label-schema.version="$version" \
|
@@ -40,16 +46,21 @@ LABEL org.label-schema.version="$version" \
|
|
40
46
|
org.label-schema.build-date="$build_date"
|
41
47
|
|
42
48
|
COPY --from=build /workspace/r10k.gem /
|
49
|
+
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
|
43
50
|
# ignore apk and gem pinning
|
44
51
|
# hadolint ignore=DL3018,DL3028
|
45
|
-
RUN chmod a+x /adduser.sh && \
|
52
|
+
RUN chmod a+x /adduser.sh /docker-entrypoint.sh && \
|
46
53
|
# Add a puppet user to run r10k as for consistency with puppetserver
|
47
54
|
/adduser.sh && \
|
48
|
-
chmod +x /docker-entrypoint.sh && \
|
49
55
|
chown -R puppet: /docker-entrypoint.d /docker-entrypoint.sh && \
|
50
56
|
apk add --no-cache ruby openssh-client git ruby-rugged curl ruby-json ruby-etc && \
|
51
57
|
gem install --no-doc /r10k.gem && \
|
52
|
-
rm -f /r10k.gem
|
58
|
+
rm -f /r10k.gem && \
|
59
|
+
curl --fail --silent --show-error --location --remote-name "$supercronic_url" && \
|
60
|
+
echo "${supercronic_sha1sum} ${supercronic}" | sha1sum -c - && \
|
61
|
+
chmod +x "$supercronic" && \
|
62
|
+
mv "$supercronic" "/usr/local/bin/${supercronic}" && \
|
63
|
+
ln -s "/usr/local/bin/${supercronic}" /usr/local/bin/supercronic
|
53
64
|
|
54
65
|
USER puppet
|
55
66
|
WORKDIR /home/puppet
|
@@ -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
|
@@ -6,6 +7,11 @@ ARG version="3.1.0"
|
|
6
7
|
# Used by entrypoint to submit metrics to Google Analytics.
|
7
8
|
# Published images should use "production" for this build_arg.
|
8
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"
|
9
15
|
|
10
16
|
LABEL org.label-schema.maintainer="Puppet Release Team <release@puppet.com>" \
|
11
17
|
org.label-schema.vendor="Puppet" \
|
@@ -16,7 +22,7 @@ LABEL org.label-schema.maintainer="Puppet Release Team <release@puppet.com>" \
|
|
16
22
|
org.label-schema.schema-version="1.0" \
|
17
23
|
org.label-schema.dockerfile="/release.Dockerfile"
|
18
24
|
|
19
|
-
COPY docker-entrypoint.sh /
|
25
|
+
COPY adduser.sh docker-entrypoint.sh /
|
20
26
|
COPY docker-entrypoint.d /docker-entrypoint.d
|
21
27
|
|
22
28
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
@@ -29,8 +35,21 @@ LABEL org.label-schema.version="$version" \
|
|
29
35
|
org.label-schema.vcs-ref="$vcs_ref" \
|
30
36
|
org.label-schema.build-date="$build_date"
|
31
37
|
|
32
|
-
|
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 && \
|
42
|
+
/adduser.sh && \
|
43
|
+
chown -R puppet: /docker-entrypoint.d /docker-entrypoint.sh && \
|
33
44
|
apk add --no-cache ruby openssh-client git ruby-rugged curl ruby-dev make gcc musl-dev && \
|
34
|
-
gem install --no-doc r10k:"$version" json etc
|
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
|
35
54
|
|
36
55
|
COPY release.Dockerfile /
|
@@ -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
|
+
:branch => 'master'
|
34
|
+
|
35
|
+
mod 'test_apache',
|
36
|
+
:git => 'git://github.com/puppetlabs/puppetlabs-apache.git',
|
37
|
+
:branch => 'master'
|
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")
|
@@ -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/runner.rb
CHANGED
@@ -46,6 +46,7 @@ module R10K
|
|
46
46
|
overrides[:cachedir] = @opts[:cachedir] if @opts.key?(:cachedir)
|
47
47
|
overrides[:deploy] = {} if @opts.key?(:'puppet-path') || @opts.key?(:'generate-types')
|
48
48
|
overrides[:deploy][:puppet_path] = @opts[:'puppet-path'] if @opts.key?(:'puppet-path')
|
49
|
+
overrides[:deploy][:puppet_conf] = @opts[:'puppet-conf'] unless @opts[:'puppet-conf'].nil?
|
49
50
|
overrides[:deploy][:generate_types] = @opts[:'generate-types'] if @opts.key?(:'generate-types')
|
50
51
|
|
51
52
|
with_overrides = config_settings.merge(overrides) do |key, oldval, newval|
|
@@ -54,6 +55,10 @@ module R10K
|
|
54
55
|
newval
|
55
56
|
end
|
56
57
|
|
58
|
+
# Credentials from the CLI override both the global and per-repo
|
59
|
+
# credentials from the config, and so need to be handled specially
|
60
|
+
with_overrides = add_credential_overrides(with_overrides)
|
61
|
+
|
57
62
|
@settings = R10K::Settings.global_settings.evaluate(with_overrides)
|
58
63
|
|
59
64
|
R10K::Initializers::GlobalInitializer.new(@settings).call
|
@@ -91,6 +96,35 @@ module R10K
|
|
91
96
|
|
92
97
|
results
|
93
98
|
end
|
99
|
+
|
100
|
+
def add_credential_overrides(overrides)
|
101
|
+
sshkey_path = @opts[:'private-key']
|
102
|
+
token_path = @opts[:'oauth-token']
|
103
|
+
|
104
|
+
if sshkey_path && token_path
|
105
|
+
raise R10K::Error, "Cannot specify both an SSH key and a token to use with this deploy."
|
106
|
+
end
|
107
|
+
|
108
|
+
if sshkey_path
|
109
|
+
overrides[:git] ||= {}
|
110
|
+
overrides[:git][:private_key] = sshkey_path
|
111
|
+
if repo_settings = overrides[:git][:repositories]
|
112
|
+
repo_settings.each do |repo|
|
113
|
+
repo[:private_key] = sshkey_path
|
114
|
+
end
|
115
|
+
end
|
116
|
+
elsif token_path
|
117
|
+
overrides[:git] ||= {}
|
118
|
+
overrides[:git][:oauth_token] = token_path
|
119
|
+
if repo_settings = overrides[:git][:repositories]
|
120
|
+
repo_settings.each do |repo|
|
121
|
+
repo[:oauth_token] = token_path
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
overrides
|
127
|
+
end
|
94
128
|
end
|
95
129
|
end
|
96
130
|
end
|
data/lib/r10k/cli/deploy.rb
CHANGED
@@ -21,7 +21,7 @@ module R10K::CLI
|
|
21
21
|
(https://puppet.com/docs/puppet/latest/environments_about.html).
|
22
22
|
DESCRIPTION
|
23
23
|
|
24
|
-
|
24
|
+
option nil, :cachedir, 'Specify a cachedir, overriding the value in config', argument: :required
|
25
25
|
flag nil, :'no-force', 'Prevent the overwriting of local module modifications'
|
26
26
|
flag nil, :'generate-types', 'Run `puppet generate types` after updating an environment'
|
27
27
|
option nil, :'puppet-path', 'Path to puppet executable', argument: :required do |value, cmd|
|
@@ -31,6 +31,9 @@ module R10K::CLI
|
|
31
31
|
exit 1
|
32
32
|
end
|
33
33
|
end
|
34
|
+
option nil, :'puppet-conf', 'Path to puppet.conf', argument: :required
|
35
|
+
option nil, :'private-key', 'Path to SSH key to use when cloning. Only valid with rugged provider', argument: :required
|
36
|
+
option nil, :'oauth-token', 'Path to OAuth token to use when cloning. Only valid with rugged provider', argument: :required
|
34
37
|
|
35
38
|
run do |opts, args, cmd|
|
36
39
|
puts cmd.help(:verbose => opts[:verbose])
|
@@ -61,7 +64,8 @@ scheduled. On subsequent deployments, Puppetfile deployment will default to off.
|
|
61
64
|
DESCRIPTION
|
62
65
|
|
63
66
|
flag :p, :puppetfile, 'Deploy modules from a puppetfile'
|
64
|
-
|
67
|
+
option nil, :'default-branch-override', 'Specify a branchname to override the default branch in the puppetfile',
|
68
|
+
argument: :required
|
65
69
|
|
66
70
|
runner R10K::Action::CriRunner.wrap(R10K::Action::Deploy::Environment)
|
67
71
|
end
|
@@ -81,7 +85,7 @@ It will load the Puppetfile configurations out of all environments, and will
|
|
81
85
|
try to deploy the given module names in all environments.
|
82
86
|
DESCRIPTION
|
83
87
|
|
84
|
-
|
88
|
+
option :e, :environment, 'Update the modules in the given environment', argument: :required
|
85
89
|
|
86
90
|
runner R10K::Action::CriRunner.wrap(R10K::Action::Deploy::Module)
|
87
91
|
end
|
@@ -99,7 +103,8 @@ try to deploy the given module names in all environments.
|
|
99
103
|
flag :p, :puppetfile, 'Display Puppetfile modules'
|
100
104
|
flag nil, :detail, 'Display detailed information'
|
101
105
|
flag nil, :fetch, 'Update available environment lists from all remote sources'
|
102
|
-
|
106
|
+
option nil, :format, 'Display output in a specific format. Valid values: json, yaml. Default: yaml',
|
107
|
+
argument: :required
|
103
108
|
|
104
109
|
runner R10K::Action::CriRunner.wrap(R10K::Action::Deploy::Display)
|
105
110
|
end
|
data/lib/r10k/cli/puppetfile.rb
CHANGED
@@ -30,8 +30,8 @@ Puppetfile (http://bombasticmonkey.com/librarian-puppet/).
|
|
30
30
|
name 'install'
|
31
31
|
usage 'install'
|
32
32
|
summary 'Install all modules from a Puppetfile'
|
33
|
-
|
34
|
-
|
33
|
+
option nil, :moduledir, 'Path to install modules to', argument: :required
|
34
|
+
option nil, :puppetfile, 'Path to puppetfile', argument: :required
|
35
35
|
flag nil, :force, 'Force locally changed files to be overwritten'
|
36
36
|
runner R10K::Action::Puppetfile::CriRunner.wrap(R10K::Action::Puppetfile::Install)
|
37
37
|
end
|
@@ -45,7 +45,7 @@ Puppetfile (http://bombasticmonkey.com/librarian-puppet/).
|
|
45
45
|
usage 'check'
|
46
46
|
summary 'Try and load the Puppetfile to verify the syntax is correct.'
|
47
47
|
|
48
|
-
|
48
|
+
option nil, :puppetfile, 'Path to Puppetfile', argument: :required
|
49
49
|
runner R10K::Action::Puppetfile::CriRunner.wrap(R10K::Action::Puppetfile::Check)
|
50
50
|
end
|
51
51
|
end
|
@@ -58,8 +58,8 @@ Puppetfile (http://bombasticmonkey.com/librarian-puppet/).
|
|
58
58
|
usage 'purge'
|
59
59
|
summary 'Purge unmanaged modules from a Puppetfile managed directory'
|
60
60
|
|
61
|
-
|
62
|
-
|
61
|
+
option nil, :moduledir, 'Path to install modules to', argument: :required
|
62
|
+
option nil, :puppetfile, 'Path to Puppetfile', argument: :required
|
63
63
|
runner R10K::Action::Puppetfile::CriRunner.wrap(R10K::Action::Puppetfile::Purge)
|
64
64
|
end
|
65
65
|
end
|