r10k 2.6.9 → 3.0.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 +5 -5
- data/.gitignore +1 -0
- data/.travis.yml +9 -16
- data/CHANGELOG.mkd +23 -36
- data/Gemfile +2 -1
- data/MAINTAINERS +18 -0
- data/README.mkd +1 -5
- data/bin/r10k +2 -2
- data/doc/common-patterns.mkd +2 -2
- data/doc/dynamic-environments/configuration.mkd +1 -2
- data/doc/dynamic-environments/quickstart.mkd +3 -3
- data/doc/dynamic-environments/usage.mkd +0 -12
- data/doc/puppetfile.mkd +0 -18
- data/docker/Gemfile +13 -0
- data/docker/ci/build +72 -0
- data/docker/distelli-manifest.yml +4 -0
- data/docker/r10k/Dockerfile +41 -0
- data/docker/r10k/spec/dockerfile_spec.rb +16 -0
- data/integration/Gemfile +4 -2
- data/integration/Rakefile +3 -2
- data/integration/pre-suite/00_pe_install.rb +0 -1
- data/integration/pre-suite/30_test_utils.rb +17 -0
- 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/install_pe_only_module_with_puppetfile.rb +2 -2
- data/integration/tests/basic_functionality/negative/attempt_to_install_peonly_module_without_license.rb +71 -0
- data/integration/tests/basic_functionality/proxy_with_pe_only_module.rb +2 -2
- data/integration/tests/git_source/HTTP_proxy_and_git_source.rb +2 -2
- data/integration/tests/i18n/deploy_module_with_unicode_in_file_name.rb +64 -0
- data/integration/tests/purging/does_not_purge_files_on_white_list.rb +93 -0
- data/integration/tests/purging/invalid_whitelist_types.rb +63 -0
- data/integration/tests/user_scenario/basic_workflow/negative/neg_disk_full.rb +12 -2
- data/integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb +1 -8
- data/integration/tests/user_scenario/basic_workflow/single_env_10000_files.rb +11 -2
- data/integration/tests/user_scenario/basic_workflow/single_env_large_files.rb +12 -2
- data/lib/r10k/action/deploy/environment.rb +2 -15
- data/lib/r10k/action/puppetfile/check.rb +1 -1
- data/lib/r10k/action/puppetfile/cri_runner.rb +1 -13
- data/lib/r10k/action/puppetfile/purge.rb +1 -1
- data/lib/r10k/cli/deploy.rb +0 -1
- data/lib/r10k/cli/puppetfile.rb +4 -0
- data/lib/r10k/environment/base.rb +7 -1
- data/lib/r10k/environment/svn.rb +1 -1
- data/lib/r10k/forge/module_release.rb +2 -2
- data/lib/r10k/git/rugged/base_repository.rb +6 -3
- data/lib/r10k/git/rugged/working_repository.rb +10 -1
- data/lib/r10k/git/shellgit/base_repository.rb +27 -8
- data/lib/r10k/git/shellgit/working_repository.rb +20 -6
- data/lib/r10k/git/stateful_repository.rb +0 -1
- data/lib/r10k/module/git.rb +0 -5
- data/lib/r10k/puppetfile.rb +22 -27
- data/lib/r10k/source/base.rb +6 -0
- data/lib/r10k/source/git.rb +2 -2
- data/lib/r10k/source/svn.rb +4 -2
- data/lib/r10k/util/purgeable.rb +4 -2
- data/lib/r10k/util/subprocess/runner/posix.rb +3 -3
- data/lib/r10k/version.rb +1 -4
- data/locales/r10k.pot +23 -19
- data/r10k.gemspec +4 -8
- data/r10k.yaml.example +6 -0
- data/spec/fixtures/unit/puppetfile/duplicate-module-error/Puppetfile +10 -0
- data/spec/fixtures/unit/puppetfile/name-error/Puppetfile +1 -0
- data/spec/shared-examples/git/working_repository.rb +46 -0
- data/spec/unit/action/deploy/environment_spec.rb +0 -63
- data/spec/unit/action/puppetfile/check_spec.rb +24 -9
- data/spec/unit/action/puppetfile/cri_runner_spec.rb +2 -20
- data/spec/unit/action/puppetfile/install_spec.rb +16 -16
- data/spec/unit/action/puppetfile/purge_spec.rb +29 -6
- data/spec/unit/forge/module_release_spec.rb +10 -6
- data/spec/unit/git/stateful_repository_spec.rb +1 -4
- data/spec/unit/puppetfile_spec.rb +43 -36
- metadata +33 -48
- data/.github/pull_request_template.md +0 -4
- data/.github/workflows/release.yml +0 -36
- data/CODEOWNERS +0 -1
- data/spec/fixtures/unit/puppetfile/default-branch-override/Puppetfile +0 -5
data/integration/Gemfile
CHANGED
@@ -10,8 +10,10 @@ def location_for(place, fake_version = nil)
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
gem 'beaker', *location_for(ENV['BEAKER_VERSION'] || '~>
|
14
|
-
gem 'beaker-pe', '~>
|
13
|
+
gem 'beaker', *location_for(ENV['BEAKER_VERSION'] || '~> 3.33')
|
14
|
+
gem 'beaker-pe', '~> 1.22'
|
15
|
+
gem 'beaker-answers'
|
15
16
|
gem 'beaker-hostgenerator', *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'] || '~> 1.1')
|
16
17
|
gem 'beaker-abs', *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.4')
|
17
18
|
gem 'rototiller', '= 0.1.0'
|
19
|
+
gem 'beaker-qa-i18n'
|
data/integration/Rakefile
CHANGED
@@ -24,6 +24,7 @@ pre-suite/00_pe_install.rb,
|
|
24
24
|
component/pre-suite/05_install_dev_r10k.rb,
|
25
25
|
pre-suite/10_git_config.rb,
|
26
26
|
pre-suite/20_pe_r10k.rb,
|
27
|
+
pre-suite/30_test_utils.rb,
|
27
28
|
EOS
|
28
29
|
common_setup.gsub!("\n", '')
|
29
30
|
|
@@ -44,8 +45,8 @@ EOS
|
|
44
45
|
|
45
46
|
t.add_env do |env|
|
46
47
|
env.name = 'pe_dist_dir'
|
47
|
-
env.message = 'The location to download PE from
|
48
|
-
ENV['pe_dist_dir'] ||= "
|
48
|
+
env.message = 'The location to download PE from example "http://enterprise.delivery.puppetlabs.net/20XX.X/ci-ready"'
|
49
|
+
ENV['pe_dist_dir'] ||= "http://enterprise.delivery.puppetlabs.net/#{ENV['PE_FAMILY']}/ci-ready"
|
49
50
|
end
|
50
51
|
|
51
52
|
t.add_env do |env|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
test_name 'CODEMGMT-62 - C63199 - Install Utilities for r10k Integration Testing'
|
2
|
+
|
3
|
+
#Init
|
4
|
+
filebucket_path = '/opt/filebucket'
|
5
|
+
filebucket_script_path = '/etc/profile.d/filebucket_path.sh'
|
6
|
+
|
7
|
+
filebucket_script = <<-SCRIPT
|
8
|
+
#!/bin/bash
|
9
|
+
export PATH="${PATH}:#{filebucket_path}"
|
10
|
+
SCRIPT
|
11
|
+
|
12
|
+
step 'Install "filebucket" File Generator'
|
13
|
+
create_remote_file(master, filebucket_script_path, filebucket_script)
|
14
|
+
on(master, "git clone git://github.com/puppetlabs/filebucket.git #{filebucket_path}")
|
15
|
+
|
16
|
+
on(master, "chmod 755 #{filebucket_script_path}")
|
17
|
+
on(master, "chmod 755 #{filebucket_path}/filebucketapp.py")
|
@@ -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.
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
SCRIPT_PATH=$(pwd)
|
3
|
+
BASENAME_CMD="basename ${SCRIPT_PATH}"
|
4
|
+
SCRIPT_BASE_PATH=`eval ${BASENAME_CMD}`
|
5
|
+
|
6
|
+
if [ $SCRIPT_BASE_PATH = "scripts" ]; then
|
7
|
+
cd ../
|
8
|
+
fi
|
9
|
+
|
10
|
+
export pe_dist_dir=http://neptune.puppetlabs.lan/4.0/ci-ready/
|
11
|
+
export GIT_PROVIDER=shellgit
|
12
|
+
|
13
|
+
bundle install --path .bundle/gems
|
14
|
+
|
15
|
+
bundle exec beaker \
|
16
|
+
--preserve-hosts always \
|
17
|
+
--config configs/pe/centos-5-64mda \
|
18
|
+
--debug \
|
19
|
+
--keyfile ~/.ssh/id_rsa-acceptance \
|
20
|
+
--pre-suite pre-suite \
|
21
|
+
--load-path lib
|
22
|
+
|
23
|
+
rm -rf .bundle
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
SCRIPT_PATH=$(pwd)
|
3
|
+
BASENAME_CMD="basename ${SCRIPT_PATH}"
|
4
|
+
SCRIPT_BASE_PATH=`eval ${BASENAME_CMD}`
|
5
|
+
|
6
|
+
if [ $SCRIPT_BASE_PATH = "scripts" ]; then
|
7
|
+
cd ../
|
8
|
+
fi
|
9
|
+
|
10
|
+
export pe_dist_dir=http://neptune.puppetlabs.lan/4.0/ci-ready/
|
11
|
+
export GIT_PROVIDER=shellgit
|
12
|
+
|
13
|
+
bundle install --path .bundle/gems
|
14
|
+
|
15
|
+
bundle exec beaker \
|
16
|
+
--preserve-hosts always \
|
17
|
+
--config configs/pe/centos-6-64mda \
|
18
|
+
--debug \
|
19
|
+
--keyfile ~/.ssh/id_rsa-acceptance \
|
20
|
+
--pre-suite pre-suite \
|
21
|
+
--load-path lib
|
22
|
+
|
23
|
+
rm -rf .bundle
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
SCRIPT_PATH=$(pwd)
|
3
|
+
BASENAME_CMD="basename ${SCRIPT_PATH}"
|
4
|
+
SCRIPT_BASE_PATH=`eval ${BASENAME_CMD}`
|
5
|
+
|
6
|
+
if [ $SCRIPT_BASE_PATH = "scripts" ]; then
|
7
|
+
cd ../
|
8
|
+
fi
|
9
|
+
|
10
|
+
export pe_dist_dir=http://neptune.puppetlabs.lan/4.0/ci-ready/
|
11
|
+
export GIT_PROVIDER=shellgit
|
12
|
+
|
13
|
+
bundle install --path .bundle/gems
|
14
|
+
|
15
|
+
bundle exec beaker \
|
16
|
+
--preserve-hosts always \
|
17
|
+
--config configs/pe/redhat-7-64mda \
|
18
|
+
--debug \
|
19
|
+
--keyfile ~/.ssh/id_rsa-acceptance \
|
20
|
+
--pre-suite pre-suite \
|
21
|
+
--load-path lib
|
22
|
+
|
23
|
+
rm -rf .bundle
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
SCRIPT_PATH=$(pwd)
|
3
|
+
BASENAME_CMD="basename ${SCRIPT_PATH}"
|
4
|
+
SCRIPT_BASE_PATH=`eval ${BASENAME_CMD}`
|
5
|
+
|
6
|
+
if [ $SCRIPT_BASE_PATH = "scripts" ]; then
|
7
|
+
cd ../
|
8
|
+
fi
|
9
|
+
|
10
|
+
export pe_dist_dir=http://neptune.puppetlabs.lan/4.0/ci-ready/
|
11
|
+
export GIT_PROVIDER=shellgit
|
12
|
+
|
13
|
+
bundle install --path .bundle/gems
|
14
|
+
|
15
|
+
bundle exec beaker \
|
16
|
+
--preserve-hosts always \
|
17
|
+
--config configs/pe/sles-11-64mda \
|
18
|
+
--debug \
|
19
|
+
--keyfile ~/.ssh/id_rsa-acceptance \
|
20
|
+
--pre-suite pre-suite \
|
21
|
+
--load-path lib
|
22
|
+
|
23
|
+
rm -rf .bundle
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
SCRIPT_PATH=$(pwd)
|
3
|
+
BASENAME_CMD="basename ${SCRIPT_PATH}"
|
4
|
+
SCRIPT_BASE_PATH=`eval ${BASENAME_CMD}`
|
5
|
+
|
6
|
+
if [ $SCRIPT_BASE_PATH = "scripts" ]; then
|
7
|
+
cd ../
|
8
|
+
fi
|
9
|
+
|
10
|
+
export pe_dist_dir=http://neptune.puppetlabs.lan/4.0/ci-ready/
|
11
|
+
export GIT_PROVIDER=shellgit
|
12
|
+
|
13
|
+
bundle install --path .bundle/gems
|
14
|
+
|
15
|
+
bundle exec beaker \
|
16
|
+
--preserve-hosts always \
|
17
|
+
--config configs/pe/sles-12-64mda \
|
18
|
+
--debug \
|
19
|
+
--keyfile ~/.ssh/id_rsa-acceptance \
|
20
|
+
--pre-suite pre-suite \
|
21
|
+
--load-path lib
|
22
|
+
|
23
|
+
rm -rf .bundle
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
SCRIPT_PATH=$(pwd)
|
3
|
+
BASENAME_CMD="basename ${SCRIPT_PATH}"
|
4
|
+
SCRIPT_BASE_PATH=`eval ${BASENAME_CMD}`
|
5
|
+
|
6
|
+
if [ $SCRIPT_BASE_PATH = "scripts" ]; then
|
7
|
+
cd ../
|
8
|
+
fi
|
9
|
+
|
10
|
+
export pe_dist_dir=http://neptune.puppetlabs.lan/4.0/ci-ready/
|
11
|
+
export GIT_PROVIDER=shellgit
|
12
|
+
|
13
|
+
bundle install --path .bundle/gems
|
14
|
+
|
15
|
+
bundle exec beaker \
|
16
|
+
--preserve-hosts always \
|
17
|
+
--config configs/pe/ubuntu-1004-64mda \
|
18
|
+
--debug \
|
19
|
+
--keyfile ~/.ssh/id_rsa-acceptance \
|
20
|
+
--pre-suite pre-suite \
|
21
|
+
--load-path lib
|
22
|
+
|
23
|
+
rm -rf .bundle
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
SCRIPT_PATH=$(pwd)
|
3
|
+
BASENAME_CMD="basename ${SCRIPT_PATH}"
|
4
|
+
SCRIPT_BASE_PATH=`eval ${BASENAME_CMD}`
|
5
|
+
|
6
|
+
if [ $SCRIPT_BASE_PATH = "scripts" ]; then
|
7
|
+
cd ../
|
8
|
+
fi
|
9
|
+
|
10
|
+
export pe_dist_dir=http://neptune.puppetlabs.lan/4.0/ci-ready/
|
11
|
+
export GIT_PROVIDER=shellgit
|
12
|
+
|
13
|
+
bundle install --path .bundle/gems
|
14
|
+
|
15
|
+
bundle exec beaker \
|
16
|
+
--preserve-hosts always \
|
17
|
+
--config configs/pe/ubuntu-1204-64mda \
|
18
|
+
--debug \
|
19
|
+
--keyfile ~/.ssh/id_rsa-acceptance \
|
20
|
+
--pre-suite pre-suite \
|
21
|
+
--load-path lib
|
22
|
+
|
23
|
+
rm -rf .bundle
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
SCRIPT_PATH=$(pwd)
|
3
|
+
BASENAME_CMD="basename ${SCRIPT_PATH}"
|
4
|
+
SCRIPT_BASE_PATH=`eval ${BASENAME_CMD}`
|
5
|
+
|
6
|
+
if [ $SCRIPT_BASE_PATH = "scripts" ]; then
|
7
|
+
cd ../
|
8
|
+
fi
|
9
|
+
|
10
|
+
export pe_dist_dir=http://neptune.puppetlabs.lan/4.0/ci-ready/
|
11
|
+
export GIT_PROVIDER=shellgit
|
12
|
+
|
13
|
+
bundle install --path .bundle/gems
|
14
|
+
|
15
|
+
bundle exec beaker \
|
16
|
+
--preserve-hosts always \
|
17
|
+
--config configs/pe/ubuntu-1404-64mda \
|
18
|
+
--debug \
|
19
|
+
--keyfile ~/.ssh/id_rsa-acceptance \
|
20
|
+
--pre-suite pre-suite \
|
21
|
+
--load-path lib
|
22
|
+
|
23
|
+
rm -rf .bundle
|
@@ -58,8 +58,8 @@ on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
|
|
58
58
|
step 'Update the "r10k" Config'
|
59
59
|
create_remote_file(master, r10k_config_path, r10k_conf)
|
60
60
|
|
61
|
-
step 'Download license file from
|
62
|
-
curl_on(master, '
|
61
|
+
step 'Download license file from int-resources'
|
62
|
+
curl_on(master, 'http://int-resources.ops.puppetlabs.net/QA_resources/r10k/license.key -o /etc/puppetlabs/license.key')
|
63
63
|
|
64
64
|
step 'Inject New "site.pp" to the "production" Environment'
|
65
65
|
inject_site_pp(master, site_pp_path, site_pp)
|
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'git_utils'
|
2
|
+
require 'r10k_utils'
|
3
|
+
require 'master_manipulator'
|
4
|
+
test_name 'RK-158 - C92361 - Attempt to install a PE-only module with no license file'
|
5
|
+
|
6
|
+
#Init
|
7
|
+
env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
|
8
|
+
r10k_fqp = get_r10k_fqp(master)
|
9
|
+
master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
|
10
|
+
|
11
|
+
git_repo_path = '/git_repos'
|
12
|
+
git_repo_name = 'environments'
|
13
|
+
git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git")
|
14
|
+
git_environments_path = '/root/environments'
|
15
|
+
last_commit = git_last_commit(master, git_environments_path)
|
16
|
+
git_provider = ENV['GIT_PROVIDER'] || 'shellgit'
|
17
|
+
|
18
|
+
r10k_config_path = get_r10k_config_file_path(master)
|
19
|
+
r10k_config_bak_path = "#{r10k_config_path}.bak"
|
20
|
+
|
21
|
+
#In-line files
|
22
|
+
r10k_conf = <<-CONF
|
23
|
+
cachedir: '/var/cache/r10k'
|
24
|
+
git:
|
25
|
+
provider: '#{git_provider}'
|
26
|
+
sources:
|
27
|
+
control:
|
28
|
+
basedir: "#{env_path}"
|
29
|
+
remote: "#{git_control_remote}"
|
30
|
+
CONF
|
31
|
+
|
32
|
+
#Manifest
|
33
|
+
site_pp_path = File.join(git_environments_path, 'manifests', 'site.pp')
|
34
|
+
site_pp = create_site_pp(master_certname, ' include peonly')
|
35
|
+
|
36
|
+
# Verification
|
37
|
+
error_message_regex = /You must have a valid Puppet Enterprise® license on this node in order to download ztr-peonly/
|
38
|
+
|
39
|
+
#Teardown
|
40
|
+
teardown do
|
41
|
+
step 'Restore Original "r10k" Config'
|
42
|
+
on(master, "mv #{r10k_config_bak_path} #{r10k_config_path}")
|
43
|
+
|
44
|
+
step 'cleanup r10k'
|
45
|
+
clean_up_r10k(master, last_commit, git_environments_path)
|
46
|
+
end
|
47
|
+
|
48
|
+
#Setup
|
49
|
+
step 'Stub the forge'
|
50
|
+
stub_forge_on(master)
|
51
|
+
|
52
|
+
step 'Backup a Valid "r10k" Config'
|
53
|
+
on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
|
54
|
+
|
55
|
+
step 'Update the "r10k" Config'
|
56
|
+
create_remote_file(master, r10k_config_path, r10k_conf)
|
57
|
+
|
58
|
+
step 'Inject New "site.pp" to the "production" Environment'
|
59
|
+
inject_site_pp(master, site_pp_path, site_pp)
|
60
|
+
|
61
|
+
step 'Copy Puppetfile to "production" Environment Git Repo'
|
62
|
+
create_remote_file(master, "#{git_environments_path}/Puppetfile", 'mod "ztr-peonly"')
|
63
|
+
|
64
|
+
step 'Push Changes'
|
65
|
+
git_add_commit_push(master, 'production', 'add Puppetfile', git_environments_path)
|
66
|
+
|
67
|
+
#Test
|
68
|
+
step 'Deploy "production" Environment via r10k'
|
69
|
+
on(master, "#{r10k_fqp} deploy environment -p", :acceptable_exit_codes => [0,1]) do |result|
|
70
|
+
assert_match(error_message_regex, result.stderr, 'Expected error message was not observed!')
|
71
|
+
end
|
@@ -86,8 +86,8 @@ on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")
|
|
86
86
|
step 'Update the "r10k" Config'
|
87
87
|
create_remote_file(master, r10k_config_path, r10k_conf)
|
88
88
|
|
89
|
-
step 'Download license file from
|
90
|
-
curl_on(master, '
|
89
|
+
step 'Download license file from int-resources'
|
90
|
+
curl_on(master, 'http://int-resources.ops.puppetlabs.net/QA_resources/r10k/license.key -o /etc/puppetlabs/license.key')
|
91
91
|
|
92
92
|
step 'Checkout "production" Branch'
|
93
93
|
git_on(master, 'checkout production', git_environments_path)
|
@@ -28,7 +28,7 @@ git:
|
|
28
28
|
provider: '#{git_provider}'
|
29
29
|
repositories:
|
30
30
|
- remote: 'http://example.com/fake_git_source.git'
|
31
|
-
proxy: 'http://
|
31
|
+
proxy: 'http://foooooooo.unresolvable:3128'
|
32
32
|
sources:
|
33
33
|
control:
|
34
34
|
basedir: "#{env_path}"
|
@@ -64,7 +64,7 @@ git_add_commit_push(master, 'production', 'add Puppetfile', git_environments_pat
|
|
64
64
|
|
65
65
|
#test
|
66
66
|
on(master, "#{r10k_fqp} deploy environment -p", :accept_all_exit_codes => true) do |r|
|
67
|
-
regex = /proxy.*
|
67
|
+
regex = /proxy.*foooooooo\.unresolvable/
|
68
68
|
assert(r.exit_code == 1, 'expected error code was not observed')
|
69
69
|
assert_match(regex, r.stderr, 'The expected error message was not observed' )
|
70
70
|
end
|