r10k 1.5.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.travis.yml +0 -1
- data/CHANGELOG.mkd +63 -0
- data/Gemfile +2 -2
- data/README.mkd +1 -10
- data/doc/dynamic-environments/configuration.mkd +24 -6
- data/doc/dynamic-environments/quickstart.mkd +1 -1
- data/integration/Gemfile +1 -1
- data/integration/configs/pe/centos-5-64mda +25 -0
- data/integration/configs/pe/centos-6-64mda +1 -1
- data/integration/configs/pe/centos-7-64mda +1 -1
- data/integration/configs/pe/debian-6-64mda +1 -1
- data/integration/configs/pe/debian-7-64mda +1 -1
- data/integration/configs/pe/redhat-6-64mda +1 -1
- data/integration/configs/pe/redhat-7-64mda +1 -1
- data/integration/configs/pe/sles-11-64mda +1 -1
- data/integration/configs/pe/sles-12-64mda +25 -0
- data/integration/configs/pe/ubuntu-1004-64mda +1 -1
- data/integration/configs/pe/ubuntu-1204-64mda +1 -1
- data/integration/configs/pe/ubuntu-1404-64mda +1 -1
- data/integration/files/pre-suite/git_config.pp.erb +19 -0
- data/integration/pre-suite/01_git_config.rb +5 -17
- data/integration/pre-suite/02_pe_r10k.rb +0 -2
- data/integration/scripts/README.mkd +86 -0
- data/integration/scripts/setup_r10k_env_centos5.sh +23 -0
- data/integration/scripts/setup_r10k_env_centos6.sh +23 -0
- data/integration/scripts/setup_r10k_env_rhel7.sh +23 -0
- data/integration/scripts/setup_r10k_env_sles11.sh +23 -0
- data/integration/scripts/setup_r10k_env_sles12.sh +23 -0
- data/integration/scripts/setup_r10k_env_ubuntu1004.sh +23 -0
- data/integration/scripts/setup_r10k_env_ubuntu1204.sh +23 -0
- data/integration/scripts/setup_r10k_env_ubuntu1404.sh +23 -0
- data/integration/tests/basic_functionality/negative/neg_invalid_git_provider.rb +44 -0
- data/integration/tests/basic_functionality/rugged_git_provider_with_ssh.rb +106 -0
- data/integration/tests/basic_functionality/rugged_git_provider_without_ssh.rb +107 -0
- data/integration/tests/git_source/git_source_git.rb +1 -1
- data/integration/tests/git_source/git_source_ssh.rb +1 -1
- data/integration/tests/git_source/negative/neg_git_unauthorized_https.rb +1 -1
- data/integration/tests/git_source/negative/neg_git_unauthorized_ssh.rb +1 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_basedir.rb +1 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_module.rb +8 -2
- data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_module_ref.rb +1 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_remote.rb +1 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_branch_name_collision.rb +1 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_disk_full.rb +5 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb +3 -3
- data/integration/tests/user_scenario/basic_workflow/negative/neg_invalid_puppet_file.rb +1 -1
- data/integration/tests/user_scenario/basic_workflow/negative/neg_read_only.rb +1 -1
- data/integration/tests/user_scenario/basic_workflow/single_env_10000_files.rb +4 -0
- data/integration/tests/user_scenario/basic_workflow/single_env_large_files.rb +4 -0
- data/integration/tests/user_scenario/complex_workflow/multi_env_unamanaged.rb +77 -0
- data/integration/tests/user_scenario/complex_workflow/single_env_git_module_update.rb +99 -0
- data/lib/r10k/action/deploy/display.rb +0 -1
- data/lib/r10k/action/runner.rb +20 -0
- data/lib/r10k/cli.rb +0 -3
- data/lib/r10k/cli/deploy.rb +0 -3
- data/lib/r10k/deployment.rb +1 -7
- data/lib/r10k/deployment/config.rb +15 -1
- data/lib/r10k/deployment/config/loader.rb +0 -11
- data/lib/r10k/environment/git.rb +0 -9
- data/lib/r10k/environment/svn.rb +0 -9
- data/lib/r10k/errors.rb +0 -3
- data/lib/r10k/feature.rb +24 -3
- data/lib/r10k/forge/module_release.rb +142 -0
- data/lib/r10k/git.rb +32 -11
- data/lib/r10k/module/forge.rb +25 -54
- data/lib/r10k/module_repository/forge.rb +2 -5
- data/lib/r10k/puppetfile.rb +1 -1
- data/lib/r10k/util/license.rb +20 -0
- data/lib/r10k/version.rb +1 -1
- data/lib/shared/puppet_forge/connection.rb +62 -0
- data/lib/shared/puppet_forge/error.rb +28 -0
- data/lib/shared/puppet_forge/tar.rb +10 -0
- data/lib/shared/puppet_forge/tar/mini.rb +81 -0
- data/lib/shared/puppet_forge/unpacker.rb +68 -0
- data/lib/shared/puppet_forge/v3.rb +13 -0
- data/lib/shared/puppet_forge/v3/module.rb +66 -0
- data/lib/shared/puppet_forge/v3/module_release.rb +73 -0
- data/lib/shared/puppet_forge/version.rb +3 -0
- data/r10k.gemspec +2 -2
- data/r10k.yaml.example +80 -5
- data/spec/spec_helper.rb +0 -12
- data/spec/unit/action/runner_spec.rb +53 -0
- data/spec/unit/deployment/config/loader_spec.rb +5 -19
- data/spec/unit/deployment/config_spec.rb +8 -0
- data/spec/unit/deployment_spec.rb +1 -1
- data/spec/unit/forge/module_release_spec.rb +130 -0
- data/spec/unit/git_spec.rb +5 -5
- data/spec/unit/module/forge_spec.rb +66 -116
- data/spec/unit/module_repository/forge_spec.rb +35 -5
- data/spec/unit/module_spec.rb +10 -10
- data/spec/unit/puppet_forge/connection_spec.rb +41 -0
- data/spec/unit/puppet_forge/tar/mini_spec.rb +87 -0
- data/spec/unit/puppet_forge/tar_spec.rb +9 -0
- data/spec/unit/puppet_forge/unpacker_spec.rb +59 -0
- data/spec/unit/puppet_forge/v3/module_release_spec.rb +68 -0
- data/spec/unit/puppet_forge/v3/module_spec.rb +67 -0
- metadata +48 -112
- data/lib/r10k/cli/environment.rb +0 -28
- data/lib/r10k/cli/environment/deploy.rb +0 -26
- data/lib/r10k/cli/environment/list.rb +0 -23
- data/lib/r10k/cli/environment/stale.rb +0 -24
- data/lib/r10k/cli/module.rb +0 -29
- data/lib/r10k/cli/module/deploy.rb +0 -27
- data/lib/r10k/cli/module/list.rb +0 -24
- data/lib/r10k/cli/synchronize.rb +0 -27
- data/lib/r10k/deployment/basedir.rb +0 -4
- data/lib/r10k/deployment/environment.rb +0 -20
- data/lib/r10k/deployment/source.rb +0 -37
- data/lib/r10k/git/commit.rb +0 -22
- data/lib/r10k/git/head.rb +0 -36
- data/lib/r10k/git/ref.rb +0 -66
- data/lib/r10k/git/remote_head.rb +0 -19
- data/lib/r10k/git/repository.rb +0 -158
- data/lib/r10k/git/tag.rb +0 -29
- data/lib/r10k/git/working_dir.rb +0 -186
- data/lib/r10k/registry.rb +0 -4
- data/lib/r10k/semver.rb +0 -128
- data/lib/r10k/task.rb +0 -12
- data/lib/r10k/task/deployment.rb +0 -164
- data/lib/r10k/task/environment.rb +0 -31
- data/lib/r10k/task/module.rb +0 -19
- data/lib/r10k/task/puppetfile.rb +0 -102
- data/lib/r10k/task_runner.rb +0 -72
- data/lib/r10k/util/monkey_patches.rb +0 -11
- data/spec/fixtures/vcr/cassettes/R10K_ModuleRepository_Forge/and_the_expected_version_is_latest/can_fetch_all_versions_of_a_given_module.yml +0 -187
- data/spec/fixtures/vcr/cassettes/R10K_ModuleRepository_Forge/and_the_expected_version_is_latest/can_fetch_the_latest_version_of_a_given_module.yml +0 -187
- data/spec/fixtures/vcr/cassettes/R10K_ModuleRepository_Forge/and_the_expected_version_is_latest/ignores_deleted_releases.yml +0 -190
- data/spec/fixtures/vcr/cassettes/R10K_ModuleRepository_Forge/it_handles_errors_from_forgeapi_puppetlabs_com/raises_an_error_for_a_non-existant_module.yml +0 -34
- data/spec/fixtures/vcr/cassettes/R10K_Module_Forge/and_the_expected_version_is_latest/sets_the_expected_version_based_on_the_latest_forge_version.yml +0 -103
- data/spec/shared-examples/git-ref.rb +0 -49
- data/spec/unit/deployment/environment_spec.rb +0 -25
- data/spec/unit/git/commit_spec.rb +0 -34
- data/spec/unit/git/head_spec.rb +0 -22
- data/spec/unit/git/ref_spec.rb +0 -45
- data/spec/unit/git/repository_spec.rb +0 -34
- data/spec/unit/git/tag_spec.rb +0 -32
- data/spec/unit/git/working_dir_spec.rb +0 -122
- data/spec/unit/util/monkey_patches_spec.rb +0 -20
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
OTUyZGI3NDlmOTVkZTNjMjhkMThmNjNiMGQ1NzlkMjg4YzAzZTZlMA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NzFhY2VkNWU1M2JhMzI1ZmFmZTQ1YzIyNTRjZjA5YzliMDY2MTRhZQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MDUxZjBkYmQxOWNhOTBhMDgyNWY0NWIzYzZhOGNjODM4YWJiMzEzMDQ5OWE1
|
10
|
+
YTViZGUxOWU4YTllMzZkMDY2NWViZTE4MzMzNDY5YzIwYzMyZjczNDNlOTJh
|
11
|
+
MWUyZjM0OWM5NWRmNWIzZDJjZWU5ZDAzYjdhYWVmMDRlYTIxNjA=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MTIwMjc2Njg2NzBhNTQ3NDVhYmRiOWY5ZmNlYjY1Y2NlYWYzNjI2ZjRjMWUz
|
14
|
+
NDg0YWU5ODUwNTY4Y2YxNjRjY2Q3N2IyNThiOWEyNzQ2NzU1NWYzMTZhMzNj
|
15
|
+
N2Q2NzVmMDhlYTMzZGU0NGI2NDUzNjhiNWQzMmI0NWNkMjk5YWQ=
|
data/.travis.yml
CHANGED
data/CHANGELOG.mkd
CHANGED
@@ -1,6 +1,69 @@
|
|
1
1
|
CHANGELOG
|
2
2
|
=========
|
3
3
|
|
4
|
+
2.0.0
|
5
|
+
-----
|
6
|
+
|
7
|
+
2015/06/08
|
8
|
+
|
9
|
+
This is a backwards incompatible feature release, but as major releases go this
|
10
|
+
is a pretty small one. Some changes introduced into master included some
|
11
|
+
breaking changes and SemVer dictates that we do a major release in this case.
|
12
|
+
Actual changes that will affect end users should be limited; the only one that
|
13
|
+
should have big impact is the removal of Ruby 1.8.7 support. Any other issues
|
14
|
+
encountered should be treated as bugs and will be fixed.
|
15
|
+
|
16
|
+
### User notes
|
17
|
+
|
18
|
+
(GH-1) Native support for installing modules from the Puppet Forge
|
19
|
+
|
20
|
+
R10k can now directly install modules from the Puppet Forge, rather than
|
21
|
+
shelling out to the Puppet module tool. This will allow for later optimizations
|
22
|
+
like caching module downloads to speed up installing module across multiple
|
23
|
+
environments.
|
24
|
+
|
25
|
+
(RK-83) Allow '-' as a module name separator
|
26
|
+
|
27
|
+
(RK-53) Remove '/etc/r10k.yaml' from config file search path.
|
28
|
+
|
29
|
+
R10k 1.5.0 added '/etc/puppetlabs/r10k/r10k.yaml' to the paths checked while
|
30
|
+
looking for a config file, in order to keep in convention with the rest of the
|
31
|
+
Puppet Labs config files. In 2.0.0 the old location, '/etc/r10k.yaml', has been
|
32
|
+
removed.
|
33
|
+
|
34
|
+
(RK-57) Notify users of purgedirs key deprecation
|
35
|
+
|
36
|
+
The purgedirs key was used in r10k 0.0.9 but has not been used in the 1.x
|
37
|
+
release series; if this setting is given then r10k will generate a warning
|
38
|
+
indicating that it is not used.
|
39
|
+
|
40
|
+
### Deprecations/Removals
|
41
|
+
|
42
|
+
(RK-47) Remove support for Ruby 1.8.7
|
43
|
+
|
44
|
+
Given that Ruby 1.8.7 has been EOL for nearly two years, it's time for r10k to
|
45
|
+
drop support for 1.8.7 as well. The Puppet 4 all in one package ships with Ruby
|
46
|
+
2.1.6, so even if you're on a platform that doesn't have Ruby 1.9 or greater you
|
47
|
+
can install r10k into the Puppet collection environment and used the bundled
|
48
|
+
Ruby.
|
49
|
+
|
50
|
+
(RK-54) Remove deprecated subcommands
|
51
|
+
|
52
|
+
R10k 1.0.0 reorganized a number of subcommands but retained the old subcommand
|
53
|
+
names for compatibility with 0.0.x; since it's been over 2 years since 1.0.0 has
|
54
|
+
been released these commands have finally been removed.
|
55
|
+
|
56
|
+
(RK-113) Remove deprecated Task classes and namespaces
|
57
|
+
|
58
|
+
The R10K::Task namespace turned out to be unwieldy in practice and has been
|
59
|
+
replaced with the R10K::Action namespace. Use that for running r10k as an
|
60
|
+
application.
|
61
|
+
|
62
|
+
(RK-114) Remove deprecated git classes
|
63
|
+
|
64
|
+
The reorganization of the Git code in 1.5.0 rendered a number of classes
|
65
|
+
obsolete; they've been removed.
|
66
|
+
|
4
67
|
1.5.1
|
5
68
|
-----
|
6
69
|
|
data/Gemfile
CHANGED
@@ -3,11 +3,11 @@ source 'https://rubygems.org'
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
group :extra do
|
6
|
-
gem 'rugged', '~> 0.21.4'
|
6
|
+
gem 'rugged', '~> 0.21.4'
|
7
7
|
end
|
8
8
|
|
9
9
|
group :development do
|
10
|
-
gem 'simplecov', '~> 0.9.1'
|
10
|
+
gem 'simplecov', '~> 0.9.1'
|
11
11
|
end
|
12
12
|
|
13
13
|
if File.exists? "#{__FILE__}.local"
|
data/README.mkd
CHANGED
@@ -19,8 +19,7 @@ Requirements
|
|
19
19
|
|
20
20
|
R10k supports the following Ruby versions:
|
21
21
|
|
22
|
-
- 1.
|
23
|
-
- 1.9.3 (Windows minimum version)
|
22
|
+
- 1.9.3
|
24
23
|
- 2.0.0
|
25
24
|
- 2.1.0
|
26
25
|
|
@@ -32,14 +31,6 @@ environments and modules.
|
|
32
31
|
- Git is required for creating environments and modules from Git
|
33
32
|
- SVN is required for creating environments and modules from SVN
|
34
33
|
|
35
|
-
### Ruby 1.8.7 is deprecated
|
36
|
-
|
37
|
-
As of r10k 1.5.0, support for Ruby 1.8.7 is deprecated. Because of the
|
38
|
-
increasing cost of supporting Ruby 1.8.7, issues only affecting 1.8.7 will be
|
39
|
-
fixed but will have a lower priority.
|
40
|
-
|
41
|
-
Support for 1.8.7 will be dropped entirely in r10k 2.0.0.
|
42
|
-
|
43
34
|
Installation
|
44
35
|
------------
|
45
36
|
|
@@ -21,13 +21,12 @@ locations for a configuration file.
|
|
21
21
|
|
22
22
|
* `{current working directory}/r10k.yaml`
|
23
23
|
* `/etc/puppetlabs/r10k/r10k.yaml` (1.5.0 and later)
|
24
|
-
* `/etc/r10k.yaml` (deprecated in 1.5.0)
|
24
|
+
* `/etc/r10k.yaml` (removed in 2.0.0, deprecated in 1.5.0)
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
use `/etc/puppetlabs/r10k/r10.yaml`.
|
26
|
+
As of 2.0.0, r10k will no longer search for a configuration file at
|
27
|
+
`/etc/r10k.yaml`. In 1.5.0 r10k added `/etc/puppetlabs/r10k/r10k.yaml` to the
|
28
|
+
configuration search path. The old location, `/etc/r10k.yaml` was deprecated
|
29
|
+
at that time.
|
31
30
|
|
32
31
|
General options
|
33
32
|
---------------
|
@@ -68,6 +67,25 @@ git:
|
|
68
67
|
See the [git provider documentation](../git/providers.mkd) for more information
|
69
68
|
regarding Git providers.
|
70
69
|
|
70
|
+
### forge
|
71
|
+
|
72
|
+
The 'forge' setting is a hash that contains settings for downloading modules
|
73
|
+
from the Puppet Forge.
|
74
|
+
|
75
|
+
#### proxy
|
76
|
+
|
77
|
+
The proxy option sets an optional HTTP proxy to use when downloading modules
|
78
|
+
from the Forge.
|
79
|
+
|
80
|
+
```yaml
|
81
|
+
forge:
|
82
|
+
proxy: 'http://my-site.proxy:3128'
|
83
|
+
```
|
84
|
+
|
85
|
+
If no proxy is given, r10k will check the environment variables 'HTTPS_PROXY',
|
86
|
+
'https_proxy', 'HTTP_PROXY', and 'http_proxy' in that order for a proxy URL.
|
87
|
+
|
88
|
+
|
71
89
|
Deployment options
|
72
90
|
------------------
|
73
91
|
|
@@ -117,7 +117,7 @@ Install r10k via Ruby Gems.
|
|
117
117
|
gem install r10k
|
118
118
|
```
|
119
119
|
|
120
|
-
Configure r10k by editing `/etc/r10k.yaml` and ensuring it has the following contents:
|
120
|
+
Configure r10k by editing `/etc/puppetlabs/r10k/r10k.yaml` and ensuring it has the following contents:
|
121
121
|
|
122
122
|
```
|
123
123
|
# The location to use for storing cached Git repos
|
data/integration/Gemfile
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
HOSTS:
|
2
|
+
centos-5-x86_64-master:
|
3
|
+
roles:
|
4
|
+
- master
|
5
|
+
- dashboard
|
6
|
+
- database
|
7
|
+
- agent
|
8
|
+
platform: el-5-x86_64
|
9
|
+
template: Delivery/Quality Assurance/Templates/vCloud/centos-5-x86_64
|
10
|
+
hypervisor: vcloud
|
11
|
+
centos-5-x86_64-agent:
|
12
|
+
roles:
|
13
|
+
- agent
|
14
|
+
- frictionless
|
15
|
+
platform: el-5-x86_64
|
16
|
+
template: Delivery/Quality Assurance/Templates/vCloud/centos-5-x86_64
|
17
|
+
hypervisor: vcloud
|
18
|
+
CONFIG:
|
19
|
+
nfs_server: none
|
20
|
+
consoleport: 443
|
21
|
+
datastore: instance0
|
22
|
+
folder: Delivery/Quality Assurance/Enterprise/Dynamic
|
23
|
+
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
|
24
|
+
pooling_api: http://vmpooler.delivery.puppetlabs.net/
|
25
|
+
forge_host: forge-aio01-petest.puppetlabs.com
|
@@ -0,0 +1,25 @@
|
|
1
|
+
HOSTS:
|
2
|
+
sles-12-x86_64-master:
|
3
|
+
roles:
|
4
|
+
- master
|
5
|
+
- dashboard
|
6
|
+
- database
|
7
|
+
- agent
|
8
|
+
platform: sles-12-x86_64
|
9
|
+
template: Delivery/Quality Assurance/Templates/vCloud/sles-12-x86_64
|
10
|
+
hypervisor: vcloud
|
11
|
+
sles-12-x86_64-agent:
|
12
|
+
roles:
|
13
|
+
- agent
|
14
|
+
- frictionless
|
15
|
+
platform: sles-12-x86_64
|
16
|
+
template: Delivery/Quality Assurance/Templates/vCloud/sles-12-x86_64
|
17
|
+
hypervisor: vcloud
|
18
|
+
CONFIG:
|
19
|
+
nfs_server: none
|
20
|
+
consoleport: 443
|
21
|
+
datastore: instance0
|
22
|
+
folder: Delivery/Quality Assurance/Enterprise/Dynamic
|
23
|
+
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
|
24
|
+
pooling_api: http://vmpooler.delivery.puppetlabs.net/
|
25
|
+
forge_host: forge-aio01-petest.puppetlabs.com
|
@@ -0,0 +1,19 @@
|
|
1
|
+
$git_package = $osfamily ? {
|
2
|
+
'Debian' => 'git-core',
|
3
|
+
default => 'git'
|
4
|
+
}
|
5
|
+
class { 'git':
|
6
|
+
package_name => $git_package
|
7
|
+
}
|
8
|
+
->
|
9
|
+
git::config { 'user.name':
|
10
|
+
value => 'Tester',
|
11
|
+
}
|
12
|
+
->
|
13
|
+
git::config { 'user.email':
|
14
|
+
value => 'tester@puppetlabs.com',
|
15
|
+
}
|
16
|
+
->
|
17
|
+
file { '<%= git_repo_path %>':
|
18
|
+
ensure => directory
|
19
|
+
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'erb'
|
1
2
|
require 'git_utils'
|
2
3
|
require 'r10k_utils'
|
3
4
|
require 'master_manipulator'
|
@@ -13,6 +14,10 @@ git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git")
|
|
13
14
|
git_control_remote_head_path = File.join(git_control_remote, 'HEAD')
|
14
15
|
git_environments_path = File.join('/root', git_repo_name)
|
15
16
|
|
17
|
+
local_files_root_path = ENV['FILES'] || 'files'
|
18
|
+
git_manifest_template_path = File.join(local_files_root_path, 'pre-suite', 'git_config.pp.erb')
|
19
|
+
git_manifest = ERB.new(File.read(git_manifest_template_path)).result(binding)
|
20
|
+
|
16
21
|
step 'Get PE Version'
|
17
22
|
pe_major = on(master, 'facter -p pe_major_version').stdout.rstrip
|
18
23
|
pe_minor = on(master, 'facter -p pe_minor_version').stdout.rstrip
|
@@ -22,23 +27,6 @@ if pe_version < 3.7
|
|
22
27
|
fail_test('This pre-suite requires PE 3.7 or above!')
|
23
28
|
end
|
24
29
|
|
25
|
-
#In-line files
|
26
|
-
git_manifest = <<-MANIFEST
|
27
|
-
class { 'git': }
|
28
|
-
->
|
29
|
-
git::config { 'user.name':
|
30
|
-
value => 'Tester',
|
31
|
-
}
|
32
|
-
->
|
33
|
-
git::config { 'user.email':
|
34
|
-
value => 'tester@puppetlabs.com',
|
35
|
-
}
|
36
|
-
->
|
37
|
-
file { '#{git_repo_path}':
|
38
|
-
ensure => directory
|
39
|
-
}
|
40
|
-
MANIFEST
|
41
|
-
|
42
30
|
#Setup
|
43
31
|
step 'Stub Forge on Master'
|
44
32
|
stub_forge_on(master)
|
@@ -40,8 +40,6 @@ on(master, "rm -rf #{prod_env_path}")
|
|
40
40
|
step 'Configure r10k'
|
41
41
|
create_remote_file(master, r10k_config_path, r10k_conf)
|
42
42
|
on(master, "chmod 644 #{r10k_config_path}")
|
43
|
-
#Work-a-round until CODEMGMT-110 is resolved
|
44
|
-
on(master, "ln -s #{r10k_config_path} /etc/r10k.yaml")
|
45
43
|
|
46
44
|
step 'Deploy "production" Environment via r10k'
|
47
45
|
on(master, 'r10k deploy environment -v')
|
@@ -0,0 +1,86 @@
|
|
1
|
+
Scripts
|
2
|
+
=======
|
3
|
+
|
4
|
+
This folder contains helper scripts for setting up manual testing environments
|
5
|
+
using [Beaker](https://github.com/puppetlabs/beaker) configuration files. The
|
6
|
+
environments created by these scripts have "r10k" fully configured along with
|
7
|
+
a Git repository with a valid "production" environment.
|
8
|
+
|
9
|
+
These scripts are specific to the Puppet Labs environment and will not work in
|
10
|
+
other environments without alteration!
|
11
|
+
|
12
|
+
## Prerequisites
|
13
|
+
|
14
|
+
To utilize this test scripts you will need to have Ruby 1.9.3 or greater
|
15
|
+
installed on your system along with Bundler. Also, the scripts utilize the
|
16
|
+
"vmpooler" for virtual machine creation. Access to the "vmpooler" machines
|
17
|
+
require having valid SSH private keys located on your local computer. Speak
|
18
|
+
with a QA team member for more information on where to find the necessary
|
19
|
+
SSH keys.
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
The scripts are written in Bash and should run on any Linux or Mac system as
|
24
|
+
long as the prerequisites mentioned above are satisfied.
|
25
|
+
|
26
|
+
### Cloning
|
27
|
+
|
28
|
+
First you will need to clone the "[r10k](https://github.com/puppetlabs/r10k)" repository on your local machine:
|
29
|
+
|
30
|
+
```bash
|
31
|
+
git clone git@github.com:puppetlabs/r10k.git
|
32
|
+
```
|
33
|
+
|
34
|
+
### Executing Script
|
35
|
+
|
36
|
+
Navigate to the integration tests "scripts" folder of the "r10k" repository
|
37
|
+
clone:
|
38
|
+
|
39
|
+
```bash
|
40
|
+
cd r10k/integration/scripts
|
41
|
+
```
|
42
|
+
|
43
|
+
There are separate scripts for each supported platform. Select a desired
|
44
|
+
platform and execute the script:
|
45
|
+
|
46
|
+
```bash
|
47
|
+
bash setup_r10k_env_centos6.sh
|
48
|
+
```
|
49
|
+
|
50
|
+
## Connecting to Machines
|
51
|
+
|
52
|
+
The setup process takes about 10 minutes to complete. Once finished Beaker
|
53
|
+
will report that all tests have been run successfully. The output log will
|
54
|
+
list the machines created. The Puppet master will have a name ending with
|
55
|
+
"-master" which you can scrape from the Beaker console output. Example:
|
56
|
+
|
57
|
+
```
|
58
|
+
a9lrs93vnujsrrg.delivery.puppetlabs.net (centos-6-x86_64-master) executed in 1.26 seconds
|
59
|
+
```
|
60
|
+
|
61
|
+
The FQDN of the Puppet master ("a9lrs93vnujsrrg.delivery.puppetlabs.net" in the
|
62
|
+
above example) will be printed to the left of the machine tag. The machine tag
|
63
|
+
is a combination of the platform and role of the virtual machine.
|
64
|
+
|
65
|
+
Now that you have the FQDN you can connect to the machine using SSH:
|
66
|
+
|
67
|
+
```bash
|
68
|
+
ssh -i private_key root@a9lrs93vnujsrrg.delivery.puppetlabs.net
|
69
|
+
```
|
70
|
+
|
71
|
+
*Note:* The correct SSH private key needs to be installed on your local machine
|
72
|
+
first. Speak with a QA representative to get the correct key for "vmpooler"
|
73
|
+
machines.
|
74
|
+
|
75
|
+
## Configuration Details
|
76
|
+
|
77
|
+
Now that you have successfully connected to the Puppet master you can begin
|
78
|
+
manual testing. The script has configured Git on the Puppet master to provide
|
79
|
+
a working "production" environment for "r10k" testing. The Git repository
|
80
|
+
serving the Puppet environments is located at "/git_repos/environments.git".
|
81
|
+
There is a Git clone of the remote repository located at "/root/environments".
|
82
|
+
|
83
|
+
When performing manual "r10k" testing you should utilize the Git clone
|
84
|
+
repository located at "/root/environments". The "r10k" configuration file
|
85
|
+
"/etc/puppetlabs/r10k/r10k.yaml" is already configured to use the remote Git
|
86
|
+
repository for deployments.
|