r10k 2.0.3 → 2.1.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 +8 -8
- data/CHANGELOG.mkd +150 -0
- data/README.mkd +10 -1
- data/doc/dynamic-environments/configuration.mkd +31 -0
- data/doc/dynamic-environments/quickstart.mkd +33 -79
- data/doc/faq.mkd +67 -0
- data/doc/git/providers.mkd +37 -0
- data/doc/puppetfile.mkd +73 -0
- data/integration/lib/r10k_utils.rb +47 -2
- data/integration/pre-suite/01_git_config.rb +9 -8
- data/integration/pre-suite/02_pe_r10k.rb +5 -8
- data/integration/scripts/setup_r10k_env_centos5.sh +1 -1
- data/integration/scripts/setup_r10k_env_centos6.sh +1 -1
- data/integration/scripts/setup_r10k_env_rhel7.sh +1 -1
- data/integration/scripts/setup_r10k_env_sles11.sh +1 -1
- data/integration/scripts/setup_r10k_env_sles12.sh +1 -1
- data/integration/scripts/setup_r10k_env_ubuntu1004.sh +1 -1
- data/integration/scripts/setup_r10k_env_ubuntu1204.sh +1 -1
- data/integration/scripts/setup_r10k_env_ubuntu1404.sh +1 -1
- data/integration/test_run_scripts/all_tests-rugged-pe-centos6.sh +1 -1
- data/integration/test_run_scripts/all_tests-rugged-pe-rhel7.sh +1 -1
- data/integration/test_run_scripts/all_tests-rugged-pe-sles11.sh +1 -1
- data/integration/test_run_scripts/all_tests-rugged-pe-ubuntu1204.sh +1 -1
- data/integration/test_run_scripts/all_tests-rugged-pe-ubuntu1404.sh +1 -1
- data/integration/test_run_scripts/all_tests-shellgit-pe-centos6.sh +1 -1
- data/integration/test_run_scripts/all_tests-shellgit-pe-rhel7.sh +1 -1
- data/integration/test_run_scripts/all_tests-shellgit-pe-sles11.sh +1 -1
- data/integration/test_run_scripts/all_tests-shellgit-pe-ubuntu1204.sh +1 -1
- data/integration/test_run_scripts/all_tests-shellgit-pe-ubuntu1404.sh +1 -1
- data/integration/test_run_scripts/basic_functionality/all_tests-pe-centos6.sh +1 -1
- data/integration/test_run_scripts/command_line/all_tests-pe-centos6.sh +1 -1
- data/integration/test_run_scripts/git_source/all_tests-pe-centos6.sh +1 -1
- data/integration/test_run_scripts/user_scenario/basic_workflow/all_tests-pe-centos6.sh +1 -1
- data/integration/test_run_scripts/user_scenario/complex_workflow/all_tests-pe-centos6.sh +1 -1
- data/integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb +83 -0
- data/integration/tests/basic_functionality/negative/attempt_to_install_peonly_module_without_license.rb +71 -0
- data/integration/tests/basic_functionality/negative/neg_deploy_with_invalid_r10k_yaml.rb +7 -2
- data/integration/tests/basic_functionality/negative/neg_deploy_with_missing_r10k_yaml.rb +3 -2
- data/integration/tests/basic_functionality/negative/neg_invalid_git_provider.rb +3 -2
- data/integration/tests/basic_functionality/negative/negative_bad_proxy.rb +56 -0
- data/integration/tests/basic_functionality/proxy_specified_in_configuration.rb +103 -0
- data/integration/tests/basic_functionality/proxy_with_puppetfile.rb +61 -0
- data/integration/tests/basic_functionality/rugged_git_provider_with_ssh.rb +2 -1
- data/integration/tests/basic_functionality/rugged_git_provider_without_ssh.rb +2 -1
- data/integration/tests/command_line/deploy_env_without_mod_update.rb +3 -2
- data/integration/tests/command_line/negative/neg_deploy_env_with_module_update.rb +3 -2
- data/integration/tests/command_line/negative/neg_invalid_cli_dep_flag.rb +2 -1
- data/integration/tests/command_line/negative/neg_invalid_cli_env_flag.rb +2 -1
- data/integration/tests/command_line/negative/neg_invalid_cmd_line_arg.rb +3 -4
- data/integration/tests/git_source/git_source_git.rb +7 -2
- data/integration/tests/git_source/git_source_ssh.rb +3 -2
- data/integration/tests/git_source/git_source_submodule.rb +2 -1
- data/integration/tests/git_source/negative/neg_git_broken_remote.rb +2 -1
- data/integration/tests/git_source/negative/neg_git_unauthorized_https.rb +2 -1
- data/integration/tests/git_source/negative/neg_git_unauthorized_ssh.rb +2 -1
- data/integration/tests/git_source/negative/neg_git_unicode_branch.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/multi_env_1000_branches.rb +3 -3
- 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 +9 -5
- data/integration/tests/user_scenario/basic_workflow/multi_env_hiera.rb +9 -2
- data/integration/tests/user_scenario/basic_workflow/multi_env_multi_source.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_basedir.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_forge_module.rb +7 -2
- data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_module.rb +3 -4
- data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_module_ref.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_remote.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_branch_name_collision.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_disk_full.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb +10 -4
- data/integration/tests/user_scenario/basic_workflow/negative/neg_inaccessible_forge.rb +9 -2
- data/integration/tests/user_scenario/basic_workflow/negative/neg_invalid_env_name.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_invalid_puppet_file.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_module_specified_at_deleted_release.rb +7 -2
- data/integration/tests/user_scenario/basic_workflow/negative/neg_read_only.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_specify_deleted_forge_module.rb +9 -2
- data/integration/tests/user_scenario/basic_workflow/single_env_10000_files.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_module.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/single_env_custom_module.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/single_env_large_files.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/single_env_module_already_installed.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/single_env_module_last_release_deleted.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/single_env_non-existent_base_dir.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/single_env_purge_unmanaged_modules.rb +3 -2
- data/integration/tests/user_scenario/basic_workflow/single_env_switch_forge_git_module.rb +3 -2
- data/integration/tests/user_scenario/basic_workflow/single_env_unicode_paths.rb +2 -1
- data/integration/tests/user_scenario/basic_workflow/single_env_upgrade_forge_mod_revert_change.rb +4 -3
- data/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb +3 -2
- data/integration/tests/user_scenario/complex_workflow/multi_env_remove_re-add.rb +4 -3
- data/integration/tests/user_scenario/complex_workflow/multi_env_unamanaged.rb +3 -2
- data/integration/tests/user_scenario/complex_workflow/single_env_git_module_update.rb +3 -2
- data/lib/r10k/action/base.rb +31 -0
- data/lib/r10k/action/deploy/deploy_helpers.rb +34 -0
- data/lib/r10k/action/deploy/display.rb +57 -75
- data/lib/r10k/action/deploy/environment.rb +52 -15
- data/lib/r10k/action/deploy/module.rb +13 -18
- data/lib/r10k/action/puppetfile/check.rb +8 -18
- data/lib/r10k/action/puppetfile/install.rb +13 -27
- data/lib/r10k/action/puppetfile/purge.rb +8 -17
- data/lib/r10k/action/runner.rb +39 -3
- data/lib/r10k/cli.rb +1 -3
- data/lib/r10k/cli/deploy.rb +3 -1
- data/lib/r10k/cli/puppetfile.rb +2 -2
- data/lib/r10k/deployment.rb +8 -6
- data/lib/r10k/deployment/config.rb +18 -65
- data/lib/r10k/environment/base.rb +19 -0
- data/lib/r10k/environment/git.rb +9 -0
- data/lib/r10k/environment/svn.rb +9 -0
- data/lib/r10k/forge/module_release.rb +21 -14
- data/lib/r10k/git.rb +6 -0
- data/lib/r10k/git/alternates.rb +20 -6
- data/lib/r10k/git/cache.rb +1 -1
- data/lib/r10k/git/rugged/bare_repository.rb +5 -0
- data/lib/r10k/git/rugged/base_repository.rb +6 -20
- data/lib/r10k/git/rugged/credentials.rb +66 -0
- data/lib/r10k/git/rugged/thin_repository.rb +16 -11
- data/lib/r10k/git/rugged/working_repository.rb +15 -7
- data/lib/r10k/git/shellgit/bare_repository.rb +9 -4
- data/lib/r10k/git/shellgit/thin_repository.rb +8 -10
- data/lib/r10k/git/stateful_repository.rb +1 -1
- data/lib/r10k/initializers.rb +55 -0
- data/lib/r10k/module.rb +1 -0
- data/lib/r10k/module/base.rb +3 -2
- data/lib/r10k/module/forge.rb +14 -6
- data/lib/r10k/module/local.rb +36 -0
- data/lib/r10k/module/metadata_file.rb +2 -2
- data/lib/r10k/puppetfile.rb +1 -1
- data/lib/r10k/settings.rb +86 -0
- data/lib/r10k/settings/collection.rb +118 -0
- data/lib/r10k/settings/definition.rb +112 -0
- data/lib/r10k/settings/enum_definition.rb +22 -0
- data/lib/r10k/settings/loader.rb +96 -0
- data/lib/r10k/settings/uri_definition.rb +19 -0
- data/lib/r10k/util/subprocess/runner/windows.rb +4 -4
- data/lib/r10k/version.rb +1 -1
- data/r10k.gemspec +2 -3
- data/spec/fixtures/unit/puppetfile/argument-error/Puppetfile +1 -0
- data/spec/fixtures/unit/util/subprocess/{posix/runner → runner}/no-execute.sh +0 -0
- data/spec/integration/git/rugged/thin_repository_spec.rb +2 -2
- data/spec/integration/git/rugged/working_repository_spec.rb +9 -0
- data/spec/integration/git/shellgit/thin_repository_spec.rb +2 -2
- data/spec/integration/git/stateful_repository_spec.rb +1 -1
- data/spec/r10k-mocks/mock_config.rb +10 -13
- data/spec/r10k-mocks/mock_env.rb +8 -0
- data/spec/shared-examples/deploy-actions.rb +69 -0
- data/spec/shared-examples/puppetfile-action.rb +17 -0
- data/spec/unit/action/cri_runner_spec.rb +3 -1
- data/spec/unit/action/deploy/deploy_helpers_spec.rb +38 -0
- data/spec/unit/action/deploy/display_spec.rb +31 -0
- data/spec/unit/action/deploy/environment_spec.rb +56 -0
- data/spec/unit/action/deploy/module_spec.rb +17 -0
- data/spec/unit/action/puppetfile/check_spec.rb +26 -0
- data/spec/unit/action/puppetfile/install_spec.rb +68 -0
- data/spec/unit/action/puppetfile/purge_spec.rb +19 -0
- data/spec/unit/action/runner_spec.rb +10 -9
- data/spec/unit/deployment/config_spec.rb +20 -44
- data/spec/unit/deployment_spec.rb +1 -1
- data/spec/unit/environment/git_spec.rb +20 -0
- data/spec/unit/environment/svn_spec.rb +20 -0
- data/spec/unit/forge/module_release_spec.rb +6 -3
- data/spec/unit/git/alternates_spec.rb +38 -12
- data/spec/unit/git/cache_spec.rb +4 -0
- data/spec/unit/git/rugged/credentials_spec.rb +74 -0
- data/spec/unit/initializers_spec.rb +68 -0
- data/spec/unit/module/base_spec.rb +2 -2
- data/spec/unit/module/forge_spec.rb +11 -3
- data/spec/unit/module/metadata_file_spec.rb +0 -1
- data/spec/unit/puppetfile_spec.rb +11 -0
- data/spec/unit/settings/collection_spec.rb +122 -0
- data/spec/unit/settings/definition_spec.rb +78 -0
- data/spec/unit/settings/enum_definition_spec.rb +20 -0
- data/spec/unit/{deployment/config → settings}/loader_spec.rb +50 -2
- data/spec/unit/settings/uri_definition_spec.rb +23 -0
- data/spec/unit/settings_spec.rb +151 -0
- data/spec/unit/util/subprocess/runner/posix_spec.rb +1 -1
- data/spec/unit/util/subprocess/runner/windows_spec.rb +7 -0
- metadata +53 -90
- data/lib/r10k/deployment/config/loader.rb +0 -59
- data/lib/shared/puppet/module_tool/metadata.rb +0 -197
- data/lib/shared/puppet_forge/connection.rb +0 -64
- data/lib/shared/puppet_forge/connection/connection_failure.rb +0 -26
- data/lib/shared/puppet_forge/error.rb +0 -41
- data/lib/shared/puppet_forge/tar.rb +0 -10
- data/lib/shared/puppet_forge/tar/mini.rb +0 -81
- data/lib/shared/puppet_forge/unpacker.rb +0 -68
- data/lib/shared/puppet_forge/v3.rb +0 -13
- data/lib/shared/puppet_forge/v3/module.rb +0 -69
- data/lib/shared/puppet_forge/v3/module_release.rb +0 -85
- data/lib/shared/puppet_forge/version.rb +0 -3
- data/spec/unit/puppet/module_tool/metadata_spec.rb +0 -301
- data/spec/unit/puppet_forge/connection/connection_failure_spec.rb +0 -28
- data/spec/unit/puppet_forge/connection_spec.rb +0 -41
- data/spec/unit/puppet_forge/tar/mini_spec.rb +0 -87
- data/spec/unit/puppet_forge/tar_spec.rb +0 -9
- data/spec/unit/puppet_forge/unpacker_spec.rb +0 -59
- data/spec/unit/puppet_forge/v3/module_release_spec.rb +0 -83
- data/spec/unit/puppet_forge/v3/module_spec.rb +0 -75
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
ZWM0YTE3ZTkwYmEyZDkxZTE0ZDdlMzUyOGEzODI0Zjk1ZGU4OWI4MQ==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
ZjM0ZGE5NDk2ZjE1YjM0ZDA0NjU4MzE5ZmRmYmI5NzFkYjkxMjViMw==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
MTc2MTFjZjBiNTljNGY0NzQyZDhiNDllOTFmYjEyOTY5OTA1MzViMDlhM2I4
|
|
10
|
+
MTczZjQwMWE1NjI3MTEwNjllYTlkOTcyZDgyZjFkZWI2MTYxODc5ZDhkOGZl
|
|
11
|
+
YjQxZDE2YmY4ZTc1YjY3MGJjMjE4ZWMyYzk1YmQ3NGJmZDgyZjk=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
MGJlYWJlZmU0MzczZmNjZmY4MTA1M2RhMGM2YjY3ODM5NjkwNGRhMzE5Y2Zj
|
|
14
|
+
YjMzZTU5ODk0NGIwYmFiMTVjMWJjMGY0OTIyMTFiMzcwZjUzN2JhNWE3MzY3
|
|
15
|
+
N2JlNTZlMWQ1ZGE1YTE1YjgxZDQwMWM1NDZkMGMwZDM5NjQzYjI=
|
data/CHANGELOG.mkd
CHANGED
|
@@ -1,6 +1,156 @@
|
|
|
1
1
|
CHANGELOG
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
2.1.0
|
|
5
|
+
-----
|
|
6
|
+
|
|
7
|
+
2015/10/28
|
|
8
|
+
|
|
9
|
+
### Thanks
|
|
10
|
+
|
|
11
|
+
Thanks to the following contributors for their work on this release:
|
|
12
|
+
|
|
13
|
+
* [Abel Paz](https://github.com/apazga) fixing some broken links in the Git Environments documentation
|
|
14
|
+
* [Alex Rowley](https://github.com/rowleyaj) for surfacing the --puppetfile and --module options for
|
|
15
|
+
`r10k puppetfile install`
|
|
16
|
+
* [Austin Blatt](https://github.com/austb) (our summer intern!) for extracting the vendored Puppetforge
|
|
17
|
+
code and pushing it into the upstream puppet_forge gem.
|
|
18
|
+
* [Branan Riley](https://github.com/branan) for updating the quickstart guide for Puppet 4.
|
|
19
|
+
* [Darrell](https://github.com/darrell) for adding documentation for the :local module type
|
|
20
|
+
* [David Pashley](https://github.com/dpash) for documenting potential issues with Rugged/SSH on Ubuntu
|
|
21
|
+
* [Dennis](https://github.com/pskrz) for clarifying path information in the quickstart guide
|
|
22
|
+
* [E. Dunham](https://github.com/edunham) for adding an entry to the FAQ to explain the name of r10k
|
|
23
|
+
* [Kirill Kondratenko](https://github.com/cybem) for contributing the :local module type (RK-149)
|
|
24
|
+
* [Louis Mayorga](https://github.com/lmayorga1980) for finding and reporting RK-143, and testing fixes
|
|
25
|
+
for that issue.
|
|
26
|
+
* [Mark McKinstry](https://github.com/mmckinst) for fixing some broken links in the FAQ
|
|
27
|
+
* [Patrick Robinson](https://github.com/nemski) for submitting GH-516 to catch and handle
|
|
28
|
+
ArgumentErrors raised when loading Puppetfiles
|
|
29
|
+
* [Thomas Lapinski](https://github.com/thlapin) for fixing a bug where switching from a Git module to
|
|
30
|
+
a Forge module would incorrectly leave the Git module version installed.
|
|
31
|
+
* [Thomas Mueller](https://github.com/vinzent) for updating the r10k homepage link in the gemspec.
|
|
32
|
+
|
|
33
|
+
### User notes
|
|
34
|
+
|
|
35
|
+
(RK-70) Expose Forge baseurl setting in r10k.yaml
|
|
36
|
+
|
|
37
|
+
The Puppet Forge URL can now be changed from the default forgeapi.puppetlabs.com to a user specified value.
|
|
38
|
+
This allows users to use private/testing Puppet Forge instances. See
|
|
39
|
+
https://github.com/puppetlabs/r10k/blob/master/doc/dynamic-environments/configuration.mkd#baseurl
|
|
40
|
+
for documentation on using the baseurl setting.
|
|
41
|
+
|
|
42
|
+
(RK-96) Correctly switch from Forge modules to Git modules
|
|
43
|
+
|
|
44
|
+
If a Git version of a module had been installed via a Puppetfile and the Puppetfile entry was updated to
|
|
45
|
+
use the Forge version of the module, r10k would only check the metadata - and if the metadata of the Git
|
|
46
|
+
version matched then r10k would assume that the Forge module was installed. This has been fixed so that
|
|
47
|
+
when checking the status of a Forge module r10k specifically looks for a `.git` directory and considers
|
|
48
|
+
the module mismatched when the directory is present, which means that it will correctly replace a Git
|
|
49
|
+
version of a module with the Forge version.
|
|
50
|
+
|
|
51
|
+
(RK-142) Add machine readable output for `r10k deploy display`
|
|
52
|
+
|
|
53
|
+
The output format for `r10k deploy display` was a YAML-like, janky hand rolled version; this has been
|
|
54
|
+
replaced with the ability to specify an actual data format for the output. The default output type is
|
|
55
|
+
now YAML.
|
|
56
|
+
|
|
57
|
+
(GH-477) Add `--fetch` option for `r10k deploy display`
|
|
58
|
+
|
|
59
|
+
When `r10k deploy display` is run it might be useful to see which environments don't yet exist; the
|
|
60
|
+
added `--fetch` option allows r10k to update the environment sources to check for missing environments
|
|
61
|
+
when displaying environments.
|
|
62
|
+
|
|
63
|
+
(RK-143) Use argument vector when executing commands on Windows
|
|
64
|
+
|
|
65
|
+
R10k used the `Open3.capture3` call, and used to concatenate the string to execute and join it with
|
|
66
|
+
spaces. However Windows loves including spaces in file names, which creates all sort of weird behavior
|
|
67
|
+
especially when running shell commands over SSH to Windows. This has been fixed to use the argument
|
|
68
|
+
vector form of `capture3` to avoid these issues.
|
|
69
|
+
|
|
70
|
+
(RK-149) Add :local module type
|
|
71
|
+
|
|
72
|
+
The new :local module type allows users to add modules to the Puppetfile that are included in a control
|
|
73
|
+
repository, so that modules can be kept in the Puppetfile moduledir without them being destroyed.
|
|
74
|
+
|
|
75
|
+
(CODEMGMT-345) Write deploy signatures to a file
|
|
76
|
+
|
|
77
|
+
If the code deployed by r10k is copied to another location without the cached repos, it becomes impossible
|
|
78
|
+
to use Git to interact with the repository and see which version of code r10k deployed. R10k now creates a
|
|
79
|
+
`.r10k-deploy.json` file that records the time and SHA of the last code deployment.
|
|
80
|
+
|
|
81
|
+
(RK-80) Support non SSH key based authentication for rugged provider
|
|
82
|
+
|
|
83
|
+
An error in how the Rugged Git provider provided SSH credentials prevented HTTPS urls requiring authentication
|
|
84
|
+
to function. This has been fixed so that only SSH urls are provided ssh private key credentials, and HTTPS
|
|
85
|
+
urls can provided a username and password in the URL for authentication.
|
|
86
|
+
|
|
87
|
+
(RK-90) Don't raise an error when forge modules are duplicated
|
|
88
|
+
|
|
89
|
+
A bug in how r10k Forge modules created caused r10k to crash when two forge modules tried to create the same
|
|
90
|
+
directory. This has been fixed and restores the old behavior of letting the last module specified win.
|
|
91
|
+
|
|
92
|
+
In the long term trying to specify two modules with the same name will produce an error, but in the mean time
|
|
93
|
+
this fix restores existing behavior so that r10k won't roll over and die on error.
|
|
94
|
+
|
|
95
|
+
(RK-120) Enable --config as top level command option
|
|
96
|
+
|
|
97
|
+
R10k was originally built with environment deployment in mind, but the `r10k puppetfile` subcommand made this
|
|
98
|
+
assumption faulty. However the way the config file was loaded only worked with `r10k deploy` subcommands,
|
|
99
|
+
which prevented users from using a custom cachedir or use other settings when running `r10k puppetfile`. This has
|
|
100
|
+
been corrected so that r10k can always read a config file when running any subcommand.
|
|
101
|
+
|
|
102
|
+
(RK-175) Don't crash on unresolvable Rugged ref
|
|
103
|
+
|
|
104
|
+
When r10k was using the rugged provider, checking out an unresolvable ref would throw a TypeError because r10k
|
|
105
|
+
didn't always ensure that the ref was resolvable. This has been fixed so that r10k explicitly ensures that refs
|
|
106
|
+
can be resolved before it checks them out.
|
|
107
|
+
|
|
108
|
+
(RK-174) Always ensure alternates file is up to date
|
|
109
|
+
|
|
110
|
+
When r10k created a Git working repository it permanently linked the repository to a cached Git repository via
|
|
111
|
+
the Git alternates file. However if the cachedir setting changed, existing repositories would still reference
|
|
112
|
+
the old path which could very badly break Git. This has been fixed so that r10k always ensures that the alternates
|
|
113
|
+
file is up to date before any Git operations can happen, so that changing the cachedir will not break Git repositories.
|
|
114
|
+
|
|
115
|
+
(RK-169) Print validation failures for invalid configs
|
|
116
|
+
|
|
117
|
+
R10k used to have very lax handling of config file input, which would cause crashes during r10k runtime. This
|
|
118
|
+
has been fixed so that r10k validates all configuration before it runs and prints out all configuration
|
|
119
|
+
validation errors when validation fails.
|
|
120
|
+
|
|
121
|
+
(RK-21) Indicate error when deploying non-existent environment
|
|
122
|
+
|
|
123
|
+
When r10k was deploying a specific list of environments, it would skip any existing environment that didn't match
|
|
124
|
+
the desired list of environments. However this meant that deploying a non-existent environment would not
|
|
125
|
+
deploy any environments and r10k would silently exit with an exit code of 0. This has been fixed so that
|
|
126
|
+
when r10k deploys a list of environments it makes sure that each environment can be updated, and when requested
|
|
127
|
+
environments are missing it logs an error and exits with a non-zero exit code.
|
|
128
|
+
|
|
129
|
+
(RK-163) Add deploy/write_lock setting
|
|
130
|
+
|
|
131
|
+
Users can now prevent `r10k deploy` commands that change environments and modules from running via a config
|
|
132
|
+
option; this allows users to lock out code deployments at certain times (code freezes and times outside of
|
|
133
|
+
maintenance windows.)
|
|
134
|
+
|
|
135
|
+
(GH-516) Handle ArgumentError when loading Puppetfiles
|
|
136
|
+
|
|
137
|
+
The `r10k puppetfile check` command didn't output a very useful error when a module was given the wrong number
|
|
138
|
+
of arguments; this has been fixed so that r10k catches ArgumentErrors raised while loading a Puppetfile
|
|
139
|
+
and wraps it so that more information is added to the error message.
|
|
140
|
+
|
|
141
|
+
(GH-469) Add `--puppetfile` and `--moduledir` options to `r10k puppetfile install` subcommand
|
|
142
|
+
|
|
143
|
+
The `r10k puppetfile install` subcommand was able to set a custom puppetfile path and moduledir location
|
|
144
|
+
via environment variables to match librarian-puppet, but they accidentally didn't match the librarian-puppet
|
|
145
|
+
semantics - and environment variables aren't very nice to expose for configuring and application. The
|
|
146
|
+
`r10k puppetfile install` subcommand now supports command line flags to set these options.
|
|
147
|
+
|
|
148
|
+
(CODEMGMT-339) Add command line option to set cachedir
|
|
149
|
+
|
|
150
|
+
There are some scenarios where r10k needs to be run with a common config file, but on a specific basis
|
|
151
|
+
may need to set a custom cachedir. To make this work `r10k deploy` now supports a `--cachedir` setting
|
|
152
|
+
for these temporary overrides.
|
|
153
|
+
|
|
4
154
|
2.0.3
|
|
5
155
|
-----
|
|
6
156
|
|
data/README.mkd
CHANGED
|
@@ -41,7 +41,7 @@ For general use, you should install r10k from Ruby gems:
|
|
|
41
41
|
gem install r10k
|
|
42
42
|
r10k help
|
|
43
43
|
|
|
44
|
-
### Puppet Enterprise
|
|
44
|
+
### Puppet Enterprise 3.x
|
|
45
45
|
|
|
46
46
|
Puppet Enterprise bundles a copy of Ruby, so if you do not want to use the
|
|
47
47
|
system version of Ruby with r10k, you need to use the bundled PE gem command for
|
|
@@ -50,6 +50,15 @@ installation:
|
|
|
50
50
|
/opt/puppet/bin/gem install r10k
|
|
51
51
|
r10k help
|
|
52
52
|
|
|
53
|
+
### Puppet 4
|
|
54
|
+
|
|
55
|
+
Puppet 4 bundles a copy of Ruby, so if you do not want to use the
|
|
56
|
+
system version of Ruby with r10k, you need to use the bundled puppet gem command
|
|
57
|
+
for installation.
|
|
58
|
+
|
|
59
|
+
/opt/puppetlabs/puppet/bin/gem install r10k
|
|
60
|
+
/opt/puppetlabs/puppet/bin/r10k help
|
|
61
|
+
|
|
53
62
|
### Bundler
|
|
54
63
|
|
|
55
64
|
If you have more specific needs or plan on modifying r10k you can run it out of
|
|
@@ -86,6 +86,15 @@ forge:
|
|
|
86
86
|
If no proxy is given, r10k will check the environment variables 'HTTPS_PROXY',
|
|
87
87
|
'https_proxy', 'HTTP_PROXY', and 'http_proxy' in that order for a proxy URL.
|
|
88
88
|
|
|
89
|
+
#### baseurl
|
|
90
|
+
|
|
91
|
+
The 'baseurl' setting indicates where Forge modules should be installed from.
|
|
92
|
+
This defaults to 'https://forgeapi.puppetlabs.com'
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
forge:
|
|
96
|
+
baseurl: 'https://private-forge.mysite'
|
|
97
|
+
```
|
|
89
98
|
|
|
90
99
|
Deployment options
|
|
91
100
|
------------------
|
|
@@ -121,6 +130,28 @@ sources:
|
|
|
121
130
|
# Source settings follow
|
|
122
131
|
```
|
|
123
132
|
|
|
133
|
+
### deploy
|
|
134
|
+
|
|
135
|
+
The `deploy` setting is a new top level setting for controlling how r10k deploys
|
|
136
|
+
behave. At this point only new settings are included under this setting, but in
|
|
137
|
+
the long term the current top level deploy settings will be moved under
|
|
138
|
+
`deploy`.
|
|
139
|
+
|
|
140
|
+
#### write_lock
|
|
141
|
+
|
|
142
|
+
The `write_lock` setting allows administrators to temporarily disallow r10k code
|
|
143
|
+
deploys without having to remove the r10k configuration entirely. This can be
|
|
144
|
+
useful to prevent r10k deploys at certain times or prevent r10k from interfering
|
|
145
|
+
with a common set of code that may be touched by multiple r10k configurations.
|
|
146
|
+
|
|
147
|
+
```yaml
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
deploy:
|
|
151
|
+
write_lock: "Deploying code is disallowed until the next maintenance window (2038-01-19)"
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
|
|
124
155
|
Source options
|
|
125
156
|
--------------
|
|
126
157
|
|
|
@@ -3,22 +3,23 @@
|
|
|
3
3
|
This intent of this document is to serve as a basic guide for getting started with r10k and a fresh Puppet installation, including the following:
|
|
4
4
|
|
|
5
5
|
* Installing Puppet and its dependencies
|
|
6
|
-
* Installing Hiera and its dependencies.
|
|
7
6
|
* Installing r10k and its dependencies
|
|
8
7
|
* Configuring all components to support r10k
|
|
9
8
|
* Configuring your git repository and initial files
|
|
10
9
|
|
|
10
|
+
This document is based around Puppet 4+, specifically using the Puppet Collection repositories provided by Puppet Labs.
|
|
11
|
+
|
|
11
12
|
# Pre-Requisites
|
|
12
13
|
|
|
13
|
-
* Clean install of CentOS
|
|
14
|
+
* Clean install of CentOS 7 or Debian 7.0 with root access / sudo rights.
|
|
14
15
|
* Clean github repository with a deploy key generated by the server above.
|
|
15
16
|
|
|
16
|
-
# Installing Puppetmaster on Centos
|
|
17
|
+
# Installing Puppetmaster on Centos 7
|
|
17
18
|
|
|
18
19
|
Install and enable the official Puppet Labs package repositories.
|
|
19
20
|
|
|
20
21
|
```
|
|
21
|
-
|
|
22
|
+
yum localinstall http://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
|
|
22
23
|
```
|
|
23
24
|
|
|
24
25
|
Clean all yum data and rebuild the metadata cache.
|
|
@@ -30,7 +31,7 @@ yum clean all && yum makecache
|
|
|
30
31
|
Install the Puppet master.
|
|
31
32
|
|
|
32
33
|
```
|
|
33
|
-
yum install
|
|
34
|
+
yum install puppetserver
|
|
34
35
|
```
|
|
35
36
|
|
|
36
37
|
# Installing Puppetmaster on Debian 7
|
|
@@ -38,75 +39,48 @@ yum install puppet-server
|
|
|
38
39
|
Install and enable the official Puppet Labs package repositories
|
|
39
40
|
|
|
40
41
|
```
|
|
41
|
-
wget http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb
|
|
42
|
-
dpkg -i puppetlabs-release-wheezy.deb
|
|
42
|
+
wget http://apt.puppetlabs.com/puppetlabs-release-pc1-wheezy.deb
|
|
43
|
+
dpkg -i puppetlabs-release-pc1-wheezy.deb
|
|
43
44
|
apt-get update
|
|
44
45
|
```
|
|
45
46
|
|
|
46
47
|
Install the Pupppet master
|
|
47
48
|
```
|
|
48
|
-
apt-get install
|
|
49
|
+
apt-get install puppetserver
|
|
49
50
|
```
|
|
50
|
-
Above command will install 3.7.1-1puppetlabs but there are many versions to choose. To see available versions run: apt-cache show puppetmaster-passenger|grep ^Version
|
|
51
51
|
|
|
52
|
-
# Configuring Puppet
|
|
52
|
+
# Configuring Puppet
|
|
53
53
|
|
|
54
|
-
Configure the Puppet master by editing `/etc/puppet/puppet.conf` and ensuring it has the following contents:
|
|
54
|
+
Configure the Puppet master by editing `/etc/puppetlabs/puppet/puppet.conf` and ensuring it has the following contents:
|
|
55
55
|
|
|
56
56
|
```
|
|
57
57
|
[main]
|
|
58
|
-
# The Puppet log directory.
|
|
59
|
-
# The default value is '$vardir/log'.
|
|
60
|
-
logdir = /var/log/puppet
|
|
61
|
-
|
|
62
|
-
# Where Puppet PID files are kept.
|
|
63
|
-
# The default value is '$vardir/run'.
|
|
64
|
-
rundir = /var/run/puppet
|
|
65
|
-
|
|
66
|
-
# Where SSL certificates are kept.
|
|
67
|
-
# The default value is '$confdir/ssl'.
|
|
68
|
-
ssldir = $vardir/ssl
|
|
69
|
-
|
|
70
58
|
dns_alt_names = $_Insert FQDN of Puppet Master Here_$
|
|
71
59
|
|
|
72
|
-
environmentpath = $confdir/environments
|
|
73
|
-
|
|
74
60
|
[agent]
|
|
75
|
-
# The file in which puppetd stores a list of the classes
|
|
76
|
-
# associated with the retrieved configuratiion. Can be loaded in
|
|
77
|
-
# the separate ``puppet`` executable using the ``--loadclasses``
|
|
78
|
-
# option.
|
|
79
|
-
# The default value is '$confdir/classes.txt'.
|
|
80
|
-
classfile = $vardir/classes.txt
|
|
81
|
-
|
|
82
|
-
# Where puppetd caches the local configuration. An
|
|
83
|
-
# extension indicating the cache format is added automatically.
|
|
84
|
-
# The default value is '$confdir/localconfig'.
|
|
85
|
-
localconfig = $vardir/localconfig
|
|
86
|
-
|
|
87
61
|
server = $_Insert FQDN of Puppet Master Here_$
|
|
88
62
|
```
|
|
89
63
|
|
|
90
64
|
Restart the Puppet master service.
|
|
91
65
|
|
|
92
66
|
```
|
|
93
|
-
service
|
|
67
|
+
service puppetserver restart
|
|
94
68
|
```
|
|
95
69
|
|
|
96
70
|
Ensure the certificate for the Puppet master was created.
|
|
97
71
|
|
|
98
72
|
```
|
|
99
|
-
# puppet cert list --all
|
|
73
|
+
# /opt/puppetlabs/bin/puppet cert list --all
|
|
100
74
|
|
|
101
75
|
+ "puppet-master.domain.local" (SHA256) 3F:F3:63:BB:EE:57:46:A4:7B:03:AB:9D:FD:97:0F:8F:73:87:40:3B:6D:E5:DC:FC:C3:49:F5:C9:B6:F4:DE:B8 (alt names: "DNS:puppet-master.domain.local")
|
|
102
76
|
```
|
|
103
77
|
|
|
104
|
-
Notice for Debian users: apt post-configure will build the certificate for the server BEFORE you configure it. Therefore you should rebuild your certs after done with /etc/puppet/puppet.conf configuration.
|
|
78
|
+
Notice for Debian users: apt post-configure will build the certificate for the server BEFORE you configure it. Therefore you should rebuild your certs after done with /etc/puppetlabs/puppet/puppet.conf configuration.
|
|
105
79
|
To do so you need to remove old certs and restart puppetmaster:
|
|
106
80
|
```
|
|
107
|
-
service
|
|
108
|
-
find $(puppet master --configprint ssldir) -name "$(puppet master --configprint certname).pem" -delete
|
|
109
|
-
|
|
81
|
+
service puppetserver stop
|
|
82
|
+
find $(/opt/puppetlabs/bin/puppet master --configprint ssldir) -name "$(/opt/puppetlabs/bin/puppet master --configprint certname).pem" -delete
|
|
83
|
+
service puppetserver start
|
|
110
84
|
```
|
|
111
85
|
|
|
112
86
|
# Install and Configure R10k
|
|
@@ -114,54 +88,34 @@ puppet master --no-daemonize --verbose
|
|
|
114
88
|
Install r10k via Ruby Gems.
|
|
115
89
|
|
|
116
90
|
```
|
|
117
|
-
gem install r10k
|
|
91
|
+
/opt/puppetlabs/puppet/bin/gem install r10k
|
|
118
92
|
```
|
|
119
93
|
|
|
120
|
-
Configure r10k by
|
|
94
|
+
Configure r10k by creating the following directory structure and file `/etc/puppetlabs/r10k/r10k.yaml` and ensuring it has the following contents:
|
|
121
95
|
|
|
122
96
|
```
|
|
123
97
|
# The location to use for storing cached Git repos
|
|
124
|
-
:cachedir: '/
|
|
98
|
+
:cachedir: '/opt/puppetlabs/r10k/cache'
|
|
125
99
|
|
|
126
100
|
# A list of git repositories to create
|
|
127
101
|
:sources:
|
|
128
102
|
# This will clone the git repository and instantiate an environment per
|
|
129
|
-
# branch in /etc/
|
|
103
|
+
# branch in /etc/puppetlabs/code/environments
|
|
130
104
|
:my-org:
|
|
131
105
|
remote: 'git@github.com:$_Insert GitHub Organization Here_$/$_Insert GitHub Repository That Will Be Used For Your Puppet Code Here_$'
|
|
132
|
-
basedir: '/etc/
|
|
133
|
-
```
|
|
134
|
-
# Install and Configure Hiera
|
|
135
|
-
|
|
136
|
-
Hiera is installed as part of the Puppet master installation.
|
|
137
|
-
|
|
138
|
-
Configure Hiera by editing `/etc/hiera.yaml` and ensuring it has the following contents:
|
|
139
|
-
|
|
106
|
+
basedir: '/etc/puppetlabs/code/environments'
|
|
140
107
|
```
|
|
141
|
-
---
|
|
142
|
-
:backends:
|
|
143
|
-
- yaml
|
|
144
|
-
:hierarchy:
|
|
145
|
-
- "nodes/%{fqdn}"
|
|
146
|
-
- common
|
|
147
|
-
|
|
148
|
-
:yaml:
|
|
149
|
-
:datadir: /etc/puppet/environments/%{environment}/hiera
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
Create a symlink to the Hiera configuration in the Puppet directory.
|
|
153
|
-
|
|
154
|
-
```
|
|
155
|
-
ln -s /etc/hiera.yaml /etc/puppet/hiera.yaml
|
|
156
|
-
```
|
|
157
|
-
|
|
158
108
|
# Configure Puppet Code Repository
|
|
159
109
|
|
|
160
110
|
Populate the repository by cloning it locally and performing each of the following actions within it:
|
|
161
111
|
|
|
112
|
+
Note that puppet defaults to the `production` environnment. You may wish to change your default git
|
|
113
|
+
branch from `master` to `production` in order to match this. Alternatively, you can set your agents'
|
|
114
|
+
environment to `master`.
|
|
115
|
+
|
|
162
116
|
```
|
|
163
|
-
mkdir -p {modules,site/profile/manifests,
|
|
164
|
-
touch
|
|
117
|
+
mkdir -p {modules,site/profile/manifests,hieradata}
|
|
118
|
+
touch hieradata/common.yaml
|
|
165
119
|
touch site/profile/manifests/base.pp
|
|
166
120
|
touch environment.conf
|
|
167
121
|
touch Puppetfile
|
|
@@ -181,7 +135,7 @@ Edit the `site.pp` file and ensure it has the following contents:
|
|
|
181
135
|
hiera_include('classes')
|
|
182
136
|
```
|
|
183
137
|
|
|
184
|
-
Edit the `
|
|
138
|
+
Edit the `hieradata/common.yaml file and ensure it has the following contents:
|
|
185
139
|
|
|
186
140
|
```
|
|
187
141
|
---
|
|
@@ -199,7 +153,7 @@ Edit the `Puppetfile` file and ensure it has the following contents:
|
|
|
199
153
|
forge 'forge.puppetlabs.com'
|
|
200
154
|
|
|
201
155
|
# Forge Modules
|
|
202
|
-
mod 'puppetlabs/ntp', '
|
|
156
|
+
mod 'puppetlabs/ntp', '4.1.0'
|
|
203
157
|
mod 'puppetlabs/stdlib'
|
|
204
158
|
```
|
|
205
159
|
|
|
@@ -213,7 +167,7 @@ class profile::base {
|
|
|
213
167
|
|
|
214
168
|
Ensure that the user r10k runs as (typically root) can access the git
|
|
215
169
|
repository. See the [git environment guide]
|
|
216
|
-
(
|
|
170
|
+
(git-environments.mkd) for more detail. You can test
|
|
217
171
|
the access by using su/sudo to perform `git clone yourrepoURL` as the correct
|
|
218
172
|
user.
|
|
219
173
|
|
|
@@ -232,13 +186,13 @@ This base will allow us to do all sorts of useful things. Most interesting (to m
|
|
|
232
186
|
1. Create a new branch of the Puppet code repository
|
|
233
187
|
2. Create your Puppet code in this new branch
|
|
234
188
|
3. Push the new branch up to the repository
|
|
235
|
-
4. Deploy it as a new environment using the
|
|
189
|
+
4. Deploy it as a new environment using the `/opt/puppetlabs/puppet/bin/r10k deploy environment -p` command.
|
|
236
190
|
|
|
237
191
|
From any agent node (including the master), you may run the agent against the new environment by specifying it on the command line. For example, if you create the branch `test`, run puppet as:
|
|
238
192
|
```
|
|
239
193
|
puppet agent -t --environment test
|
|
240
194
|
```
|
|
241
|
-
You can also modify the `/etc/puppet/puppet.conf` file on a node and add the environment setting to the agent section to make the change permanent:
|
|
195
|
+
You can also modify the `/etc/puppetlabs/puppet/puppet.conf` file on a node and add the environment setting to the agent section to make the change permanent:
|
|
242
196
|
```
|
|
243
197
|
...
|
|
244
198
|
[agent]
|