r10k 3.5.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dddce45b116f972f8efe10ad99c330b60186cfbcdb8747fbab2edc37d8634efb
|
4
|
+
data.tar.gz: 26ac288406c3e4fb3862aa5ca64aba4b7ed102dcc407ba59d364f094b1491480
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbe3bd1fbc2ca1f1fee87fb5ce9e613baf9783cd1a728f50e0de65718a50f7321609458a1e60817fee94ec32464b95ebf3ecf32dde5c065ccabe369fdc2c6b0d
|
7
|
+
data.tar.gz: 1d33d1f5772a71c0e6dae7b36730a810b8d2bc59e8ec71a4639b3e4f38a5394396dd62270a63032619c2a3cadeb1e1066a0242e8d9b4b1436933660aec806eab
|
@@ -10,6 +10,7 @@ jobs:
|
|
10
10
|
env:
|
11
11
|
PUPPERWARE_ANALYTICS_STREAM: production
|
12
12
|
IS_LATEST: true
|
13
|
+
# Still need these env vars for README publishing
|
13
14
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
14
15
|
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
|
15
16
|
|
@@ -17,6 +18,10 @@ jobs:
|
|
17
18
|
|
18
19
|
steps:
|
19
20
|
- uses: actions/checkout@master
|
21
|
+
- uses: azure/docker-login@v1
|
22
|
+
with: # This doesn't seem to work unless we point directly to the secrets
|
23
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
24
|
+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
20
25
|
- name: Set up Ruby 2.6
|
21
26
|
uses: actions/setup-ruby@v1
|
22
27
|
with:
|
@@ -28,5 +33,24 @@ jobs:
|
|
28
33
|
- name: Publish container
|
29
34
|
working-directory: docker
|
30
35
|
run: |
|
31
|
-
docker login -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_PASSWORD"
|
32
36
|
make publish
|
37
|
+
- name: Build release container
|
38
|
+
env:
|
39
|
+
IS_RELEASE: true
|
40
|
+
working-directory: docker
|
41
|
+
run: |
|
42
|
+
if make prep; then
|
43
|
+
make lint build test
|
44
|
+
else
|
45
|
+
echo "Skipping release container building and testing"
|
46
|
+
fi
|
47
|
+
- name: Publish release container
|
48
|
+
env:
|
49
|
+
IS_RELEASE: true
|
50
|
+
working-directory: docker
|
51
|
+
run: |
|
52
|
+
if make prep; then
|
53
|
+
make publish
|
54
|
+
else
|
55
|
+
echo "Skipping release container publishing"
|
56
|
+
fi
|
@@ -0,0 +1,81 @@
|
|
1
|
+
name: Rspec tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
rspec_tests:
|
10
|
+
name: ${{ matrix.cfg.os }}(ruby ${{ matrix.cfg.ruby }})
|
11
|
+
strategy:
|
12
|
+
matrix:
|
13
|
+
cfg:
|
14
|
+
- {os: ubuntu-18.04, ruby: 2.4}
|
15
|
+
- {os: ubuntu-18.04, ruby: 2.5}
|
16
|
+
- {os: ubuntu-18.04, ruby: 2.6}
|
17
|
+
- {os: ubuntu-18.04, ruby: 2.7}
|
18
|
+
- {os: ubuntu-18.04, ruby: jruby-9.2.9.0}
|
19
|
+
- {os: windows-2016, ruby: 2.5}
|
20
|
+
- {os: windows-2016, ruby: 2.6}
|
21
|
+
- {os: windows-2016, ruby: 2.7}
|
22
|
+
|
23
|
+
runs-on: ${{ matrix.cfg.os }}
|
24
|
+
steps:
|
25
|
+
- name: Checkout current PR
|
26
|
+
uses: actions/checkout@v2
|
27
|
+
|
28
|
+
- name: Install ruby version ${{ matrix.cfg.ruby }}
|
29
|
+
uses: ruby/setup-ruby@v1
|
30
|
+
with:
|
31
|
+
ruby-version: ${{ matrix.cfg.ruby }}
|
32
|
+
|
33
|
+
- name: Install bundler and gems
|
34
|
+
run: |
|
35
|
+
gem install bundler
|
36
|
+
bundle config set without packaging documentation
|
37
|
+
bundle install --jobs 4 --retry 3
|
38
|
+
|
39
|
+
- name: Run tests on Windows
|
40
|
+
if: runner.os == 'Windows'
|
41
|
+
run: |
|
42
|
+
# https://github.com/ruby/ruby/pull/2791/files#diff-ff5ff976e81bebd977f0834e60416abbR97-R100
|
43
|
+
# Actions uses UTF8, causes test failures, similar to normal OS setup
|
44
|
+
$PSDefaultParameterValues['*:Encoding'] = 'utf8'
|
45
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
|
46
|
+
[Console]::InputEncoding = [System.Text.Encoding]::GetEncoding("IBM437")
|
47
|
+
$Env:LOG_SPEC_ORDER = 'true'
|
48
|
+
|
49
|
+
# debug information
|
50
|
+
chcp
|
51
|
+
Get-WinSystemLocale
|
52
|
+
Get-ChildItem Env: | % { Write-Output "$($_.Key): $($_.Value)" }
|
53
|
+
# list current OpenSSL install
|
54
|
+
gem list openssl
|
55
|
+
ruby -ropenssl -e 'puts \"OpenSSL Version - #{OpenSSL::OPENSSL_VERSION}\"; puts \"OpenSSL Library Version - #{OpenSSL::OPENSSL_LIBRARY_VERSION}\"'
|
56
|
+
Get-Content Gemfile.lock
|
57
|
+
ruby -v
|
58
|
+
gem --version
|
59
|
+
bundle --version
|
60
|
+
|
61
|
+
# Run tests
|
62
|
+
bundle exec rspec --color --format documentation spec/unit
|
63
|
+
|
64
|
+
- name: Run tests on Linux
|
65
|
+
if: runner.os == 'Linux'
|
66
|
+
run: |
|
67
|
+
# debug information
|
68
|
+
cat Gemfile.lock
|
69
|
+
ruby -v
|
70
|
+
gem --version
|
71
|
+
bundle --version
|
72
|
+
|
73
|
+
if [[ ${{ matrix.cfg.ruby }} =~ "jruby" ]]; then
|
74
|
+
export _JAVA_OPTIONS='-Xmx1024m -Xms512m'
|
75
|
+
|
76
|
+
# workaround for PUP-10683
|
77
|
+
sudo apt remove rpm
|
78
|
+
fi
|
79
|
+
|
80
|
+
# Run tests
|
81
|
+
bundle exec rspec --color --format documentation spec/unit
|
data/.travis.yml
CHANGED
@@ -6,7 +6,7 @@ notifications:
|
|
6
6
|
email: false
|
7
7
|
sudo: false
|
8
8
|
jdk:
|
9
|
-
-
|
9
|
+
- openjdk11
|
10
10
|
before_install: gem install bundler -v '< 2' --no-document
|
11
11
|
matrix:
|
12
12
|
include:
|
@@ -23,20 +23,23 @@ matrix:
|
|
23
23
|
- stage: r10k tests
|
24
24
|
rvm: jruby
|
25
25
|
- stage: r10k container tests
|
26
|
-
dist:
|
26
|
+
dist: focal
|
27
27
|
language: ruby
|
28
28
|
services:
|
29
|
-
# bionic uses 18.06 but need 19.03+ for buildkit so upgrade later in relevant cell
|
30
29
|
- docker
|
31
|
-
rvm: 2.6.
|
30
|
+
rvm: 2.6.6
|
32
31
|
env:
|
32
|
+
- DOCKER_COMPOSE_VERSION=1.25.5
|
33
33
|
# necessary to prevent overwhelming TravisCI build output limits
|
34
34
|
- DOCKER_BUILD_FLAGS="--progress plain"
|
35
|
+
before_install:
|
36
|
+
- sudo rm /usr/local/bin/docker-compose
|
37
|
+
- curl --location https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname --kernel-name`-`uname --machine` > docker-compose
|
38
|
+
- chmod +x docker-compose
|
39
|
+
- sudo mv docker-compose /usr/local/bin
|
35
40
|
script:
|
36
|
-
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
cd docker && make lint build test
|
42
|
-
set +x
|
41
|
+
- set -e
|
42
|
+
- cd docker
|
43
|
+
- make lint
|
44
|
+
- make build
|
45
|
+
- make test
|
data/CHANGELOG.mkd
CHANGED
@@ -2,8 +2,39 @@ CHANGELOG
|
|
2
2
|
=========
|
3
3
|
|
4
4
|
Unreleased
|
5
|
-
|
5
|
+
----------
|
6
|
+
|
7
|
+
3.8.0
|
8
|
+
-----
|
9
|
+
|
10
|
+
- When a forge module fails name validation the offending name will now be printed in the error message. [#1126](https://github.com/puppetlabs/r10k/pull/1126)
|
11
|
+
- Module ref resolution will now fall back to the normal default branch if the default branch override cannot be resolved. [#1122](https://github.com/puppetlabs/r10k/pull/1122)
|
12
|
+
- Experimental feature change: conflicts between environment-defined modules and Puppetfile-defined modules now default to logging a warning and deploying the environment module version, overriding the Puppetfile. Previously, conflicts would result in an error. The behavior is now configurable via the `module_conflicts` environment setting [#1107](https://github.com/puppetlabs/r10k/pull/1107)
|
13
|
+
|
14
|
+
3.7.0
|
15
|
+
-----
|
16
|
+
|
17
|
+
- Use %LOCALAPPDATA% for Windows cachedir [#1049](https://github.com/puppetlabs/r10k/issues/1049)
|
18
|
+
- Add support for defining custom puppet.conf when generating types [#993](https://github.com/puppetlabs/r10k/pull/993)
|
19
|
+
- Update test cases to account for error message changes in Puppet 7
|
20
|
+
|
21
|
+
3.6.0
|
22
|
+
-----
|
23
|
+
|
24
|
+
- Add filter_command configuration option for git repositories. (Thanks to [mhumpula](https://github.com/mhumpula) for the feature.) [#823](https://github.com/puppetlabs/r10k/pull/823)
|
25
|
+
- Increase default pool_size to 4, allowing modules to be downloaded on 4 threads concurrently. [#1038](https://github.com/puppetlabs/r10k/issues/1038)
|
26
|
+
- Ensure that modules that share a cachedir download serially, to avoid cache corruption. [#1058](https://github.com/puppetlabs/r10k/issues/1058)
|
27
|
+
- Don't purge root when using `puppetfile install`. [#1084](https://github.com/puppetlabs/r10k/issues/1084)
|
6
28
|
|
29
|
+
3.5.2
|
30
|
+
-----
|
31
|
+
|
32
|
+
- (RK-319) Clean up tmp directories used for downloading modules
|
33
|
+
|
34
|
+
3.5.1
|
35
|
+
-----
|
36
|
+
|
37
|
+
- Upgrade Rugged Gemfile dependency for local development to ~> 1.0
|
7
38
|
|
8
39
|
3.5.0
|
9
40
|
-----
|
@@ -15,7 +46,7 @@ Unreleased
|
|
15
46
|
[#813](https://github.com/puppetlabs/r10k/issues/813)
|
16
47
|
|
17
48
|
3.4.1
|
18
|
-
|
49
|
+
-----
|
19
50
|
|
20
51
|
- Add support for Ruby 2.7
|
21
52
|
- (RK-357) Restrict gettext and fast_gettext versions for compatibility with Ruby 2.4
|
@@ -166,6 +197,11 @@ Ruby >= 2.3 official and documented.
|
|
166
197
|
- Unable to parse Puppetfile
|
167
198
|
- Various perfomance improvements
|
168
199
|
|
200
|
+
2.6.9
|
201
|
+
----
|
202
|
+
|
203
|
+
- Don't purge root when using `puppetfile install`. [#1084](https://github.com/puppetlabs/r10k/issues/1084)
|
204
|
+
|
169
205
|
2.6.8
|
170
206
|
----
|
171
207
|
|
@@ -394,7 +430,7 @@ Puppetfile should be installed to. See the [Puppetfile documentation](https://gi
|
|
394
430
|
|
395
431
|
You can now configure how r10k purges unmanaged content after a deployment. The
|
396
432
|
default behavior should be unchanged but there is a new "purge\_levels" configuration
|
397
|
-
option that can be used to enable new behavior or de-activate certain existing
|
433
|
+
option that can be used to enable new behavior or de-activate certain existing
|
398
434
|
behaviors. See the relevant [configuration documentation](https://github.com/puppetlabs/r10k/blob/master/doc/dynamic-environments/configuration.mkd#purge_levels) for more details.
|
399
435
|
|
400
436
|
(RK-223) Ability to track control repo branch from content declarations.
|
@@ -441,7 +477,7 @@ fix.)
|
|
441
477
|
Previously, r10k only supported the use of HTTP proxies for connecting to the Puppet
|
442
478
|
Forge. With these changes, r10k can now be configured to use an HTTP proxy for both
|
443
479
|
Forge and Git operations. Configuration can be specified globally, for Forge or Git
|
444
|
-
only, or on a per-Git repository basis. See [configuration documentation](https://github.com/puppetlabs/r10k/blob/master/doc/dynamic-environments/configuration.mkd)
|
480
|
+
only, or on a per-Git repository basis. See [configuration documentation](https://github.com/puppetlabs/r10k/blob/master/doc/dynamic-environments/configuration.mkd)
|
445
481
|
for more details.
|
446
482
|
|
447
483
|
### Bug Fixes
|
@@ -462,9 +498,9 @@ for SSH.
|
|
462
498
|
(RK-241) "deploy display" action does not properly format wrapped exceptions
|
463
499
|
|
464
500
|
The "deploy display" action was not capturing and logging exceptions in the same way as
|
465
|
-
other related actions. This meant that in many cases, when an error occurred, the
|
501
|
+
other related actions. This meant that in many cases, when an error occurred, the
|
466
502
|
underlying cause was not being shown. Specifically, the "deploy display" action was
|
467
|
-
not benefitting from the improved error messaging for unreadable SSH keys which was
|
503
|
+
not benefitting from the improved error messaging for unreadable SSH keys which was
|
468
504
|
added in r10k 2.2.0 as part of RK-220.
|
469
505
|
|
470
506
|
2.2.1
|
data/CODEOWNERS
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
* @puppetlabs/puppetserver-maintainers
|
1
|
+
* @puppetlabs/puppetserver-maintainers
|
2
2
|
/docker/ @puppetlabs/pupperware
|
data/Gemfile
CHANGED
data/README.mkd
CHANGED
@@ -17,8 +17,8 @@ implementation of Puppet [environments][workflow].
|
|
17
17
|
Requirements
|
18
18
|
------------
|
19
19
|
|
20
|
-
R10k supports the Ruby versions `>= 2.
|
21
|
-
Ruby 2.
|
20
|
+
R10k supports the Ruby versions `>= 2.4.0`. It's tested on Ruby 2.4.0 up to
|
21
|
+
Ruby 2.7.0 + Jruby.
|
22
22
|
|
23
23
|
R10k requires additional components, depending on how you plan on managing
|
24
24
|
environments and modules.
|
@@ -98,6 +98,14 @@ When localizing the strings found in R10k, follow the prescribed
|
|
98
98
|
The workflow describes the rake tasks provided to generate the .po files for
|
99
99
|
each locale.
|
100
100
|
|
101
|
+
Releasing
|
102
|
+
---------
|
103
|
+
To release a new version of the r10k gem, ensure the [changelog](CHANGELOG.mkd) is up to date and open a pull request updating the [version file](lib/r10k/version.rb). When the PR is merged, a new release of the gem will be triggered.
|
104
|
+
|
105
|
+
By default, a patch (Z) release will be triggered. To release a new major (X) or minor (Y) version, include `#major` or `#minor` (respectively) in your commit message to trigger the appropriate release.
|
106
|
+
|
107
|
+
NOTE: This currently only works for the default branch. If you would like to release from a different branch, please contact the [CODEOWNERS](CODEOWNERS).
|
108
|
+
|
101
109
|
Getting help
|
102
110
|
------------
|
103
111
|
|
@@ -113,6 +121,7 @@ Please see the CHANGELOG for a listing of the (very awesome) contributors.
|
|
113
121
|
|
114
122
|
## Maintenance
|
115
123
|
|
116
|
-
See [
|
124
|
+
See [CODEOWNERS](CODEOWNERS) for active repo maintainers.
|
125
|
+
|
126
|
+
Open [issues](https://github.com/puppetlabs/r10k/issues) directly in the r10k repo.
|
117
127
|
|
118
|
-
Tickets: File at https://tickets.puppet.com/browse/RK
|
data/azure-pipelines.yml
CHANGED
@@ -19,6 +19,7 @@ variables:
|
|
19
19
|
CONTAINER_BUILD_PATH: .
|
20
20
|
LINT_IGNORES:
|
21
21
|
DOCKER_BUILDKIT: 1
|
22
|
+
BUILD_OPTIONS: --build-arg alpine_version=3.9
|
22
23
|
|
23
24
|
workspace:
|
24
25
|
clean: resources
|
@@ -53,7 +54,7 @@ steps:
|
|
53
54
|
|
54
55
|
- powershell: |
|
55
56
|
. "$(bundle show pupperware)/ci/build.ps1"
|
56
|
-
Build-Container -Name $ENV:CONTAINER_NAME -Namespace $ENV:NAMESPACE -PathOrUri $ENV:CONTAINER_BUILD_PATH
|
57
|
+
Build-Container -Name $ENV:CONTAINER_NAME -Namespace $ENV:NAMESPACE -PathOrUri $ENV:CONTAINER_BUILD_PATH -AdditionalOptions ($ENV:BUILD_OPTIONS -split ' ')
|
57
58
|
displayName: Build $(CONTAINER_NAME) Container
|
58
59
|
timeoutInMinutes: 5
|
59
60
|
name: build_container
|
@@ -76,9 +76,9 @@ The proxy server being used will be logged at the "debug" level when r10k runs.
|
|
76
76
|
### pool_size
|
77
77
|
|
78
78
|
The pool_size setting is a number to determine how many threads should be spawn
|
79
|
-
while updating modules. The default value is
|
80
|
-
|
81
|
-
|
79
|
+
while updating modules. The default value is 4, which means modules will be updated
|
80
|
+
in parallel. If this causes issues, change this setting to 1 to cause modules to be
|
81
|
+
updated serially.
|
82
82
|
|
83
83
|
### git
|
84
84
|
|
@@ -327,6 +327,15 @@ deploy:
|
|
327
327
|
puppet_path: '/usr/local/bin/puppet'
|
328
328
|
```
|
329
329
|
|
330
|
+
#### puppet\_conf
|
331
|
+
|
332
|
+
The path to the puppet.conf file used for generating types. Defaults to `/etc/puppetlabs/puppet/puppet.conf`.
|
333
|
+
|
334
|
+
```yaml
|
335
|
+
deploy:
|
336
|
+
puppet_conf: '/opt/puppet/conf/puppet.conf'
|
337
|
+
```
|
338
|
+
|
330
339
|
Source options
|
331
340
|
--------------
|
332
341
|
|
@@ -411,6 +420,29 @@ sources:
|
|
411
420
|
- 'dev'
|
412
421
|
```
|
413
422
|
|
423
|
+
### filter_command
|
424
|
+
|
425
|
+
You can filter out any branch based on the result of the command specified as
|
426
|
+
'filter_command'. Currently it only works with git repository. Non zero return
|
427
|
+
status of the command results in a branch beeing removed. The command is passed
|
428
|
+
additional environment variables
|
429
|
+
|
430
|
+
* GIT_DIR – path to the cached git repository
|
431
|
+
* R10K_BRANCH – branch which is being filtered
|
432
|
+
* R10K_NAME – source name from r10k configuration
|
433
|
+
|
434
|
+
This can be used for example for filtering out the branches with invalid gpg signature of their latest commit
|
435
|
+
|
436
|
+
```yaml
|
437
|
+
---
|
438
|
+
sources:
|
439
|
+
mysource:
|
440
|
+
basedir: '/etc/puppet/environments'
|
441
|
+
filter_command: 'git verify-commit $R10K_BRANCH 2> /dev/null'
|
442
|
+
```
|
443
|
+
|
444
|
+
Beware that if the production branch of manifests is filtered out, you will end up with empty environment.
|
445
|
+
|
414
446
|
Examples
|
415
447
|
--------
|
416
448
|
|
@@ -641,6 +673,31 @@ modules:
|
|
641
673
|
ref: 62d07f2
|
642
674
|
```
|
643
675
|
|
676
|
+
#### Puppetfile module conflicts
|
677
|
+
|
678
|
+
When a module is defined in an environment and also in a Puppetfile, the default behavior is for the environment definition of the module to take precedence, a warning to be logged, and the Puppetfile definition to be ignored. The behavior is configurable to optionally skip the warning, or allow a hard failure instead. Use the `module_conflicts` option in an environment definition to control this.
|
679
|
+
|
680
|
+
Available `module_conflicts` options:
|
681
|
+
|
682
|
+
* `override_and_warn` (default): the version of the module defined by the environment will be used, and the version defined in the Puppetfile will be ignored. A warning will be printed.
|
683
|
+
* `override`: the version of the module defined by the environment will be used, and the version defined in the Puppetfile will be ignored.
|
684
|
+
* `error`: an error will be raised alerting the user to the conflict. The environment will not be deployed.
|
685
|
+
|
686
|
+
```yaml
|
687
|
+
# production.yaml
|
688
|
+
---
|
689
|
+
type: git
|
690
|
+
remote: git@github.com:puppetlabs/control-repo.git
|
691
|
+
ref: 8820892
|
692
|
+
module_conflicts: override_puppetfile_and_warn
|
693
|
+
modules:
|
694
|
+
puppetlabs-stdlib: 6.0.0
|
695
|
+
puppetlabs-concat: 6.1.0
|
696
|
+
reidmv-xampl:
|
697
|
+
git: https://github.com/reidmv/reidmv-xampl.git
|
698
|
+
ref: 62d07f2
|
699
|
+
```
|
700
|
+
|
644
701
|
### Bare Environment Type
|
645
702
|
|
646
703
|
A "control repository" typically contains a hiera.yaml, an environment.conf, a manifests/site.pp file, and a few other things. However, none of these are strictly necessary for an environment to be functional if modules can be deployed to it.
|
@@ -66,11 +66,12 @@ Update a single environment and specify a default branch override:
|
|
66
66
|
|
67
67
|
r10k deploy environment my_working_environment --puppetfile --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
|
|