r10k 3.4.0 → 3.6.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 -0
- data/.github/workflows/docker.yml +25 -1
- data/.github/workflows/release.yml +36 -0
- data/.travis.yml +21 -8
- data/CHANGELOG.mkd +64 -4
- data/CODEOWNERS +1 -1
- data/Gemfile +1 -1
- data/README.mkd +13 -4
- data/azure-pipelines.yml +4 -2
- data/doc/dynamic-environments/configuration.mkd +41 -4
- data/doc/dynamic-environments/git-environments.mkd +1 -1
- data/doc/dynamic-environments/master-configuration.mkd +28 -58
- data/doc/faq.mkd +6 -1
- data/doc/puppetfile.mkd +2 -0
- data/docker/Makefile +19 -3
- data/docker/r10k/Dockerfile +22 -8
- data/docker/r10k/release.Dockerfile +23 -4
- data/integration/Rakefile +2 -2
- data/integration/tests/git_source/git_source_repeated_remote.rb +68 -0
- data/lib/r10k/action/deploy/environment.rb +5 -1
- data/lib/r10k/action/deploy/module.rb +5 -1
- data/lib/r10k/action/runner.rb +4 -4
- data/lib/r10k/cli/deploy.rb +1 -1
- data/lib/r10k/forge/module_release.rb +2 -2
- data/lib/r10k/git/cache.rb +1 -3
- data/lib/r10k/git/stateful_repository.rb +4 -0
- data/lib/r10k/module/base.rb +8 -0
- data/lib/r10k/module/git.rb +4 -0
- data/lib/r10k/puppetfile.rb +26 -6
- data/lib/r10k/settings.rb +1 -1
- data/lib/r10k/source.rb +1 -0
- data/lib/r10k/source/exec.rb +51 -0
- data/lib/r10k/source/git.rb +22 -2
- data/lib/r10k/source/hash.rb +32 -8
- data/lib/r10k/version.rb +4 -1
- data/locales/r10k.pot +33 -10
- data/r10k.gemspec +5 -1
- data/spec/unit/action/deploy/module_spec.rb +15 -2
- data/spec/unit/action/puppetfile/install_spec.rb +4 -1
- data/spec/unit/action/runner_spec.rb +2 -2
- data/spec/unit/forge/module_release_spec.rb +14 -10
- data/spec/unit/puppetfile_spec.rb +67 -2
- data/spec/unit/source/exec_spec.rb +81 -0
- data/spec/unit/source/git_spec.rb +37 -1
- data/spec/unit/source/hash_spec.rb +54 -0
- data/spec/unit/source/yaml_spec.rb +42 -0
- metadata +54 -16
- data/integration/scripts/README.mkd +0 -86
- data/integration/scripts/setup_r10k_env_centos5.sh +0 -23
- data/integration/scripts/setup_r10k_env_centos6.sh +0 -23
- data/integration/scripts/setup_r10k_env_rhel7.sh +0 -23
- data/integration/scripts/setup_r10k_env_sles11.sh +0 -23
- data/integration/scripts/setup_r10k_env_sles12.sh +0 -23
- data/integration/scripts/setup_r10k_env_ubuntu1004.sh +0 -23
- data/integration/scripts/setup_r10k_env_ubuntu1204.sh +0 -23
- data/integration/scripts/setup_r10k_env_ubuntu1404.sh +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e54158e0a651c799246229971ba62ad36bd40a670ca84e61479aa5280306c8a
|
4
|
+
data.tar.gz: 153cc105ce9276d79e2501dc99accb398bba8fec423fbf0726a1b183993a2748
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 264ea2591c062d460edab02b8edf7a59c9ebc08ebea27ee2b103e43bdf71c936b797094014d66b776573196d4a9e86dfc9f0fd345626f27d7e25c8170ebaa83a
|
7
|
+
data.tar.gz: 224e40f3f13466ab2ea3296bc3741b10d591ea65c97ba60b3dd81078f70149770c07c46ac1464a44fd59af0d20dbc8bbf1a5e3990e5d7921cc05403772d99640
|
@@ -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,36 @@
|
|
1
|
+
name: Tag and release
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
paths:
|
8
|
+
- 'lib/r10k/version.rb'
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
release:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
with:
|
16
|
+
fetch-depth: '0'
|
17
|
+
- name: Bump version and push tag
|
18
|
+
uses: anothrNick/github-tag-action@1.17.2
|
19
|
+
env:
|
20
|
+
GITHUB_TOKEN: ${{ secrets.PUPPET_RELEASE_GH_TOKEN }}
|
21
|
+
DEFAULT_BUMP: patch
|
22
|
+
WITH_V: false
|
23
|
+
# Uncomment this if the tag and version file become out-of-sync and
|
24
|
+
# you need to tag at a specific version.
|
25
|
+
# CUSTOM_TAG:
|
26
|
+
- name: Build gem
|
27
|
+
uses: scarhand/actions-ruby@master
|
28
|
+
with:
|
29
|
+
args: build *.gemspec
|
30
|
+
- name: Publish gem
|
31
|
+
uses: scarhand/actions-ruby@master
|
32
|
+
env:
|
33
|
+
RUBYGEMS_AUTH_TOKEN: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
|
34
|
+
with:
|
35
|
+
args: push *.gem
|
36
|
+
|
data/.travis.yml
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
---
|
2
2
|
language: ruby
|
3
|
-
services:
|
4
|
-
- docker
|
5
3
|
bundler_args: "--without system"
|
6
4
|
script: "bundle exec rspec --color --format documentation spec/unit"
|
7
5
|
notifications:
|
8
6
|
email: false
|
9
7
|
sudo: false
|
10
8
|
jdk:
|
11
|
-
-
|
9
|
+
- openjdk11
|
12
10
|
before_install: gem install bundler -v '< 2' --no-document
|
13
11
|
matrix:
|
14
12
|
include:
|
13
|
+
- stage: r10k tests
|
14
|
+
rvm: 2.7.0
|
15
15
|
- stage: r10k tests
|
16
16
|
rvm: 2.6.5
|
17
17
|
- stage: r10k tests
|
@@ -23,10 +23,23 @@ matrix:
|
|
23
23
|
- stage: r10k tests
|
24
24
|
rvm: jruby
|
25
25
|
- stage: r10k container tests
|
26
|
+
dist: focal
|
26
27
|
language: ruby
|
27
|
-
|
28
|
+
services:
|
29
|
+
- docker
|
30
|
+
rvm: 2.6.6
|
31
|
+
env:
|
32
|
+
- DOCKER_COMPOSE_VERSION=1.25.5
|
33
|
+
# necessary to prevent overwhelming TravisCI build output limits
|
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
|
28
40
|
script:
|
29
|
-
-
|
30
|
-
|
31
|
-
|
32
|
-
|
41
|
+
- set -e
|
42
|
+
- cd docker
|
43
|
+
- make lint
|
44
|
+
- make build
|
45
|
+
- make test
|
data/CHANGELOG.mkd
CHANGED
@@ -1,6 +1,45 @@
|
|
1
1
|
CHANGELOG
|
2
2
|
=========
|
3
3
|
|
4
|
+
Unreleased
|
5
|
+
----------
|
6
|
+
|
7
|
+
3.6.0
|
8
|
+
-----
|
9
|
+
|
10
|
+
- 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)
|
11
|
+
- Increase default pool_size to 4, allowing modules to be downloaded on 4 threads concurrently. [#1038](https://github.com/puppetlabs/r10k/issues/1038)
|
12
|
+
- Ensure that modules that share a cachedir download serially, to avoid cache corruption. [#1058](https://github.com/puppetlabs/r10k/issues/1058)
|
13
|
+
- Don't purge root when using `puppetfile install`. [#1084](https://github.com/puppetlabs/r10k/issues/1084)
|
14
|
+
|
15
|
+
3.5.2
|
16
|
+
-----
|
17
|
+
|
18
|
+
- (RK-319) Clean up tmp directories used for downloading modules
|
19
|
+
|
20
|
+
3.5.1
|
21
|
+
-----
|
22
|
+
|
23
|
+
- Upgrade Rugged Gemfile dependency for local development to ~> 1.0
|
24
|
+
|
25
|
+
3.5.0
|
26
|
+
-----
|
27
|
+
|
28
|
+
- Add exec environment source type. The exec source type allows for the
|
29
|
+
implementation of external environment sources
|
30
|
+
[#1042](https://github.com/puppetlabs/r10k/pull/1042).
|
31
|
+
- Improve atomicity of .r10k-deploy.json writes. Fixes
|
32
|
+
[#813](https://github.com/puppetlabs/r10k/issues/813)
|
33
|
+
|
34
|
+
3.4.1
|
35
|
+
-----
|
36
|
+
|
37
|
+
- Add support for Ruby 2.7
|
38
|
+
- (RK-357) Restrict gettext and fast_gettext versions for compatibility with Ruby 2.4
|
39
|
+
- Bump cri to 2.15.10
|
40
|
+
- (RK-360) Allow overriding the cachedir in `deploy module`
|
41
|
+
- Bump puppet_forge to 2.3.0
|
42
|
+
|
4
43
|
3.4.0
|
5
44
|
-----
|
6
45
|
|
@@ -144,6 +183,27 @@ Ruby >= 2.3 official and documented.
|
|
144
183
|
- Unable to parse Puppetfile
|
145
184
|
- Various perfomance improvements
|
146
185
|
|
186
|
+
2.6.9
|
187
|
+
----
|
188
|
+
|
189
|
+
- Don't purge root when using `puppetfile install`. [#1084](https://github.com/puppetlabs/r10k/issues/1084)
|
190
|
+
|
191
|
+
2.6.8
|
192
|
+
----
|
193
|
+
|
194
|
+
### Changes
|
195
|
+
|
196
|
+
(RK-357) Restrict gettext and fast_gettext versions for compatibility with Ruby 2.4.
|
197
|
+
(RK-358) Update puppet_forge to ~> 2.3.0.
|
198
|
+
|
199
|
+
2.6.7
|
200
|
+
----
|
201
|
+
|
202
|
+
### Changes
|
203
|
+
|
204
|
+
(CDPE-1813) Add module deploy info to .r10k-deploy.json.
|
205
|
+
(RK-351) Update minitar to ~> 0.9.0.
|
206
|
+
|
147
207
|
2.6.6
|
148
208
|
----
|
149
209
|
|
@@ -356,7 +416,7 @@ Puppetfile should be installed to. See the [Puppetfile documentation](https://gi
|
|
356
416
|
|
357
417
|
You can now configure how r10k purges unmanaged content after a deployment. The
|
358
418
|
default behavior should be unchanged but there is a new "purge\_levels" configuration
|
359
|
-
option that can be used to enable new behavior or de-activate certain existing
|
419
|
+
option that can be used to enable new behavior or de-activate certain existing
|
360
420
|
behaviors. See the relevant [configuration documentation](https://github.com/puppetlabs/r10k/blob/master/doc/dynamic-environments/configuration.mkd#purge_levels) for more details.
|
361
421
|
|
362
422
|
(RK-223) Ability to track control repo branch from content declarations.
|
@@ -403,7 +463,7 @@ fix.)
|
|
403
463
|
Previously, r10k only supported the use of HTTP proxies for connecting to the Puppet
|
404
464
|
Forge. With these changes, r10k can now be configured to use an HTTP proxy for both
|
405
465
|
Forge and Git operations. Configuration can be specified globally, for Forge or Git
|
406
|
-
only, or on a per-Git repository basis. See [configuration documentation](https://github.com/puppetlabs/r10k/blob/master/doc/dynamic-environments/configuration.mkd)
|
466
|
+
only, or on a per-Git repository basis. See [configuration documentation](https://github.com/puppetlabs/r10k/blob/master/doc/dynamic-environments/configuration.mkd)
|
407
467
|
for more details.
|
408
468
|
|
409
469
|
### Bug Fixes
|
@@ -424,9 +484,9 @@ for SSH.
|
|
424
484
|
(RK-241) "deploy display" action does not properly format wrapped exceptions
|
425
485
|
|
426
486
|
The "deploy display" action was not capturing and logging exceptions in the same way as
|
427
|
-
other related actions. This meant that in many cases, when an error occurred, the
|
487
|
+
other related actions. This meant that in many cases, when an error occurred, the
|
428
488
|
underlying cause was not being shown. Specifically, the "deploy display" action was
|
429
|
-
not benefitting from the improved error messaging for unreadable SSH keys which was
|
489
|
+
not benefitting from the improved error messaging for unreadable SSH keys which was
|
430
490
|
added in r10k 2.2.0 as part of RK-220.
|
431
491
|
|
432
492
|
2.2.1
|
data/CODEOWNERS
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
* @puppetlabs/puppetserver-maintainers
|
1
|
+
* @puppetlabs/puppetserver-maintainers @adrienthebo @dhollinger
|
2
2
|
/docker/ @puppetlabs/pupperware
|
data/Gemfile
CHANGED
data/README.mkd
CHANGED
@@ -8,11 +8,11 @@ Puppet environment and module deployment
|
|
8
8
|
Description
|
9
9
|
-----------
|
10
10
|
|
11
|
-
[workflow]:
|
11
|
+
[workflow]: https://puppet.com/docs/puppet/latest/environments_about.html
|
12
12
|
|
13
13
|
R10k provides a general purpose toolset for deploying Puppet environments and
|
14
14
|
modules. It implements the [Puppetfile](doc/puppetfile.mkd) format and provides a native
|
15
|
-
implementation of Puppet [
|
15
|
+
implementation of Puppet [environments][workflow].
|
16
16
|
|
17
17
|
Requirements
|
18
18
|
------------
|
@@ -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
@@ -17,7 +17,9 @@ variables:
|
|
17
17
|
NAMESPACE: puppet
|
18
18
|
CONTAINER_NAME: r10k
|
19
19
|
CONTAINER_BUILD_PATH: .
|
20
|
-
LINT_IGNORES:
|
20
|
+
LINT_IGNORES:
|
21
|
+
DOCKER_BUILDKIT: 1
|
22
|
+
BUILD_OPTIONS: --build-arg alpine_version=3.9
|
21
23
|
|
22
24
|
workspace:
|
23
25
|
clean: resources
|
@@ -52,7 +54,7 @@ steps:
|
|
52
54
|
|
53
55
|
- powershell: |
|
54
56
|
. "$(bundle show pupperware)/ci/build.ps1"
|
55
|
-
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 ' ')
|
56
58
|
displayName: Build $(CONTAINER_NAME) Container
|
57
59
|
timeoutInMinutes: 5
|
58
60
|
name: build_container
|
@@ -48,7 +48,7 @@ cachedir: '/var/cache/r10k'
|
|
48
48
|
|
49
49
|
|
50
50
|
The cachedir setting defaults to `~/.r10k`. If the HOME environment variable is
|
51
|
-
unset r10k will assume that r10k is being run with the Puppet [`prerun_command`](
|
51
|
+
unset r10k will assume that r10k is being run with the Puppet [`prerun_command`](https://puppet.com/docs/puppet/latest/configuration.html#preruncommand)
|
52
52
|
setting and will set the cachedir default to `/root/.r10k`.
|
53
53
|
|
54
54
|
### proxy
|
@@ -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
|
|
@@ -411,6 +411,29 @@ sources:
|
|
411
411
|
- 'dev'
|
412
412
|
```
|
413
413
|
|
414
|
+
### filter_command
|
415
|
+
|
416
|
+
You can filter out any branch based on the result of the command specified as
|
417
|
+
'filter_command'. Currently it only works with git repository. Non zero return
|
418
|
+
status of the command results in a branch beeing removed. The command is passed
|
419
|
+
additional environment variables
|
420
|
+
|
421
|
+
* GIT_DIR – path to the cached git repository
|
422
|
+
* R10K_BRANCH – branch which is being filtered
|
423
|
+
* R10K_NAME – source name from r10k configuration
|
424
|
+
|
425
|
+
This can be used for example for filtering out the branches with invalid gpg signature of their latest commit
|
426
|
+
|
427
|
+
```yaml
|
428
|
+
---
|
429
|
+
sources:
|
430
|
+
mysource:
|
431
|
+
basedir: '/etc/puppet/environments'
|
432
|
+
filter_command: 'git verify-commit $R10K_BRANCH 2> /dev/null'
|
433
|
+
```
|
434
|
+
|
435
|
+
Beware that if the production branch of manifests is filtered out, you will end up with empty environment.
|
436
|
+
|
414
437
|
Examples
|
415
438
|
--------
|
416
439
|
|
@@ -578,6 +601,20 @@ remote: git@github.com:puppetlabs/control-repo.git
|
|
578
601
|
ref: 8820892
|
579
602
|
```
|
580
603
|
|
604
|
+
### Exec environment Source
|
605
|
+
|
606
|
+
The exec environment source runs an external command which is expected to return on stdout content compatible with the YAML environment source data format. The command may return the data in JSON or YAML form. The exec environment source is similar in purpose to Puppet's exec node terminus, used to implement external node classifiers (ENCs). R10k's exec source type allows the the implementation of external environment sources.
|
607
|
+
|
608
|
+
```yaml
|
609
|
+
# r10k.yaml
|
610
|
+
---
|
611
|
+
sources:
|
612
|
+
puppet:
|
613
|
+
type: exec
|
614
|
+
basedir: /etc/puppetlabs/code/environments
|
615
|
+
command: /usr/local/bin/r10k-environments.sh
|
616
|
+
```
|
617
|
+
|
581
618
|
### Environment Modules
|
582
619
|
|
583
620
|
The environment modules feature allows module content to be attached to an environment at environment definition time. This happens before modules specified in a Puppetfile are attached to an environment, which does not happen until deploy time. Environment module implementation depends on the environment source type.
|
@@ -29,7 +29,7 @@ seamlessly reflected in Puppet environments. This means that creating a new Git
|
|
29
29
|
branch creates a new Puppet environment, updating a Git branch will update that
|
30
30
|
environment, and deleting a Git branch will remove that environment.
|
31
31
|
|
32
|
-
R10k supports both [directory and config file environments](https://
|
32
|
+
R10k supports both [directory and config file environments](https://puppet.com/docs/puppet/latest/env_environments.html).
|
33
33
|
Ensure that the basedir for your sources and your puppet config align.
|
34
34
|
|
35
35
|
How it works
|
@@ -1,70 +1,40 @@
|
|
1
1
|
Puppet master configuration
|
2
2
|
===========================
|
3
3
|
|
4
|
-
In order to use
|
4
|
+
In order to use environments, your Puppet masters will need to be
|
5
5
|
configured to load manifests and modules relative to the requested environment.
|
6
|
-
The following settings should be configured in puppet.conf.
|
7
6
|
|
8
|
-
|
7
|
+
This is the default behavior in Puppet 4+
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
settings. When environments is loaded the settings are dynamically set based on
|
13
|
-
the name of the environment, thus allowing environments to be created on the
|
14
|
-
fly.
|
9
|
+
This behavior is controled by the following settings
|
10
|
+
(listed with their default values):
|
15
11
|
|
16
|
-
|
17
|
-
|
12
|
+
```
|
13
|
+
codedir = /etc/puppetlabs/code
|
14
|
+
environmentpath = $codedir/environments
|
15
|
+
basemodulepath = $codedir/modules:/opt/puppetlabs/puppet/share/modules
|
16
|
+
```
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
# If you use a specific site wide manifest
|
22
|
-
manifest = /etc/puppet/environments/$environment/manifests/nodes.pp
|
18
|
+
The environment requested by the agent or assigned to it by an ENC is looked
|
19
|
+
for at `$environmentpath/$environment`.
|
23
20
|
|
24
|
-
|
21
|
+
That environment may have an environment.conf file in its base directory that
|
22
|
+
specifies its own modulepath. If not, the default computed modulepath for that
|
23
|
+
environment is `$environmentpath/$environment/modules:$basemodulepath`.
|
25
24
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
These configuration variables are documented at
|
26
|
+
[Puppet Configuration Reference](https://puppet.com/docs/puppet/latest/configuration.html)
|
27
|
+
and their interaction in forming the modulepath is documented at
|
28
|
+
[Directories and the Modulepath](https://puppet.com/docs/puppet/latest/dirs_modulepath.html).
|
29
|
+
More information can be found about environments in general at
|
30
|
+
[Creating Environmnets](https://puppet.com/docs/puppet/latest/environments_creating.html).
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
The evolution to using environments in this way was a gradual one from community
|
33
|
+
conventions to supported feature and there were several intermediate stages that
|
34
|
+
had different configuration requirements within the puppet.conf. Some Puppet
|
35
|
+
documentation from the 3.x and 4.x series may no longer be applicable to the
|
36
|
+
above which solidified in Puppet 4.x.
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
## Puppet >= 3.6.0
|
42
|
-
|
43
|
-
[environmentconf]: http://docs.puppetlabs.com/puppet/latest/reference/config_file_environment.html
|
44
|
-
|
45
|
-
Puppet 3.6.0 adds more fine grained control over how directory environments are
|
46
|
-
configured. Each directory based environment can have an
|
47
|
-
[`environment.conf`][environmentconf] file in the root of that environment that
|
48
|
-
can specify the manifest, modulepath, config_version, and environment_timeout
|
49
|
-
for that specific environment.
|
50
|
-
|
51
|
-
# puppet.conf
|
52
|
-
[master]
|
53
|
-
# None of modulepath, manifestdir, or manifest should be enabled
|
54
|
-
# See http://docs.puppetlabs.com/puppet/latest/reference/environments.html#enabling-directory-environments
|
55
|
-
# for more information on the changes
|
56
|
-
environmentpath = $confdir/environments
|
57
|
-
|
58
|
-
- - -
|
59
|
-
|
60
|
-
# environment.conf
|
61
|
-
manifest = site.pp
|
62
|
-
moduledir = modules:dist
|
63
|
-
|
64
|
-
A deployed environment with a Puppetfile will look something like this:
|
65
|
-
|
66
|
-
.
|
67
|
-
├── Puppetfile
|
68
|
-
├── environment.conf
|
69
|
-
├── dist
|
70
|
-
└── modules
|
38
|
+
If you need to upgrade away from any intermediate setup see
|
39
|
+
[Environments in Puppet 3.8](https://puppet.com/docs/puppet/3.8/environments.html)
|
40
|
+
for examples that may help.
|