kitchen-puppet 0.0.27 → 0.0.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +27 -27
- data/kitchen-puppet.gemspec +28 -27
- data/lib/kitchen-puppet/version.rb +7 -7
- data/lib/kitchen/provisioner/puppet/librarian.rb +78 -78
- data/lib/kitchen/provisioner/puppet_agent.rb +384 -384
- data/lib/kitchen/provisioner/puppet_apply.rb +847 -846
- data/lib/kitchen/provisioner/puppet_apply_spec.rb +33 -33
- data/provisioner_options.md +196 -196
- metadata +4 -3
@@ -1,33 +1,33 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Author:: Chris Lundquist (<chris.lundquist@github.com>) Neill Turner (<neillwturner@gmail.com>)
|
4
|
-
#
|
5
|
-
# Copyright (C) 2013,2014 Chris Lundquist, Neill Turner
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
|
19
|
-
require_relative '../../spec_helper'
|
20
|
-
require 'kitchen'
|
21
|
-
|
22
|
-
# Work around for lazy loading
|
23
|
-
require 'kitchen/provisioner/puppet_apply'
|
24
|
-
|
25
|
-
describe Kitchen::Provisioner::PuppetApply do
|
26
|
-
let(:provisioner) do
|
27
|
-
Kitchen::Provisioner.for_plugin('puppet_apply', {})
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'should give a sane run_command' do
|
31
|
-
provisioner.run_command.must_match 'puppet apply'
|
32
|
-
end
|
33
|
-
end
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Author:: Chris Lundquist (<chris.lundquist@github.com>) Neill Turner (<neillwturner@gmail.com>)
|
4
|
+
#
|
5
|
+
# Copyright (C) 2013,2014 Chris Lundquist, Neill Turner
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
|
19
|
+
require_relative '../../spec_helper'
|
20
|
+
require 'kitchen'
|
21
|
+
|
22
|
+
# Work around for lazy loading
|
23
|
+
require 'kitchen/provisioner/puppet_apply'
|
24
|
+
|
25
|
+
describe Kitchen::Provisioner::PuppetApply do
|
26
|
+
let(:provisioner) do
|
27
|
+
Kitchen::Provisioner.for_plugin('puppet_apply', {})
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should give a sane run_command' do
|
31
|
+
provisioner.run_command.must_match 'puppet apply'
|
32
|
+
end
|
33
|
+
end
|
data/provisioner_options.md
CHANGED
@@ -1,196 +1,196 @@
|
|
1
|
-
|
2
|
-
# Puppet Apply Provisioner Options
|
3
|
-
|
4
|
-
key | default value | Notes
|
5
|
-
----|---------------|--------
|
6
|
-
puppet_version | "latest"| desired version, affects apt installs.
|
7
|
-
puppet_platform | naively tries to determine | OS platform of server
|
8
|
-
require_puppet_repo | true | Set if using a puppet install from yum or apt repo
|
9
|
-
puppet_apt_repo | "http://apt.puppetlabs.com/puppetlabs-release-precise.deb"| apt repo
|
10
|
-
puppet_yum_repo | "https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm"| yum repo
|
11
|
-
require_puppet_collections | false | Set if using puppet collections install (Puppet v4)
|
12
|
-
puppet_yum_collections_repo | "http://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm" | yum collections repo
|
13
|
-
puppet_apt_collections_repo | "http://apt.puppetlabs.com/puppetlabs-release-pc1-wheezy.deb" | apt collections repo
|
14
|
-
puppet_coll_remote_path | "/opt/puppetlabs" | Server Installation location of a puppet collections install.
|
15
|
-
puppet_detailed_exitcodes | nil | Provide transaction information via exit codes.
|
16
|
-
manifests_path | | puppet repo manifests directory
|
17
|
-
manifest | 'site.pp' | manifest for puppet apply to run
|
18
|
-
modules_path | | puppet repo manifests directory
|
19
|
-
files_path | | directory to place at /tmp/kitchen/files
|
20
|
-
fileserver_config_path | | file to place fileserver.conf
|
21
|
-
hiera_config_path | | path to hiera.yaml
|
22
|
-
hiera_data_path | | puppet repo hiera data directory
|
23
|
-
hiera_data_remote_path | "/var/lib/hiera" | Hiera data directory on server
|
24
|
-
puppet_debug| false| Enable full debugging logging on puppet run
|
25
|
-
puppet_verbose| false| Extra information logging on puppet run
|
26
|
-
puppet_noop| false| puppet runs in a no-op or dry-run mode
|
27
|
-
puppet_git_init | nil | initialize puppet from GIT repository, e.g. "git@github.com:example/puppet-repo.git"
|
28
|
-
puppet_git_pr | nil | checkout specific Pull Request from repository specified in puppet_git_init, e.g. "324"
|
29
|
-
update_package_repos| true| update OS repository metadata
|
30
|
-
custom_facts| Hash.new | Hash to set the puppet facts before running puppet apply
|
31
|
-
install_custom_facts| false | Install custom facts to yaml file at "/tmp/kitchen/facter/kitchen.yaml"
|
32
|
-
chef_bootstrap_url |"https://www.getchef.com/chef/install.sh"| the chef (needed for busser to run tests) NOTE: kitchen 1.4 only requires ruby to run busser so this is not required.
|
33
|
-
puppetfile_path | | Path to Puppetfile
|
34
|
-
puppet_apply_command | nil | Overwrite the puppet apply command. Needs "sudo -E puppet apply" as a prefix.
|
35
|
-
require_chef_for_busser | true | Install chef as currently needed by busser to run tests
|
36
|
-
resolve_with_librarian_puppet | true | Use librarian_puppet to resolve modules if a Puppetfile is found
|
37
|
-
librarian_puppet_ssl_file | nil | ssl certificate file for librarian-puppet
|
38
|
-
puppet_config_path | | path of custom puppet.conf file
|
39
|
-
puppet_environment | nil | puppet environment for running puppet apply (Must set if using Puppet v4)
|
40
|
-
remove_puppet_repo | false | remove copy of puppet repository and puppet configuration on server after running puppet
|
41
|
-
hiera_eyaml | false | use hiera-eyaml to encrypt hiera data
|
42
|
-
hiera_eyaml_key_remote_path | "/etc/puppet/secure/keys" | directory of hiera-eyaml keys on server
|
43
|
-
hiera_eyaml_key_path | "hiera_keys" | directory of hiera-eyaml keys on workstation
|
44
|
-
hiera_deep_merge | false | install the deep_merge gem to support hiera deep merge mode
|
45
|
-
facter_file | nil | yaml file of custom facter_files to be provided to the puppet-apply command
|
46
|
-
http_proxy | nil | use http proxy when installing puppet, packages and running puppet
|
47
|
-
https_proxy | nil | use https proxy when installing puppet, packages and running puppet
|
48
|
-
puppet_logdest | nil | _Array_ of log destinations. Include 'console' if wanted
|
49
|
-
|
50
|
-
|
51
|
-
## Puppet Apply Configuring Provisioner Options
|
52
|
-
|
53
|
-
The provisioner can be configured globally or per suite, global settings act as defaults for all suites, you can then customise per suite, for example:
|
54
|
-
|
55
|
-
```yaml
|
56
|
-
---
|
57
|
-
driver:
|
58
|
-
name: vagrant
|
59
|
-
|
60
|
-
provisioner:
|
61
|
-
name: puppet_apply
|
62
|
-
manifests_path: /repository/puppet_repo/manifests
|
63
|
-
modules_path: /repository/puppet_repo/modules-mycompany
|
64
|
-
hiera_data_path: /repository/puppet_repo/hieradata
|
65
|
-
|
66
|
-
platforms:
|
67
|
-
- name: nocm_ubuntu-12.04
|
68
|
-
driver_plugin: vagrant
|
69
|
-
driver_config:
|
70
|
-
box: nocm_ubuntu-12.04
|
71
|
-
box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
|
72
|
-
|
73
|
-
suites:
|
74
|
-
- name: default
|
75
|
-
```
|
76
|
-
|
77
|
-
**NOTE:** With Test-Kitchen 1.4 you not longer need chef install to run the tests. You just need ruby installed version 1.9 or higher and also add to the .kitchen.yml file
|
78
|
-
|
79
|
-
```yaml
|
80
|
-
verifier:
|
81
|
-
ruby_bindir: '/usr/bin'
|
82
|
-
```
|
83
|
-
where /usr/bin is the location of the ruby command.
|
84
|
-
|
85
|
-
in this example, vagrant will download a box for ubuntu 1204 with no configuration management installed, then install the
|
86
|
-
latest puppet and puppet apply against a puppet repo from the /repository/puppet_repo directory using the defailt manifest site.pp
|
87
|
-
|
88
|
-
To override a setting at the suite-level, specify the setting name under the suite:
|
89
|
-
|
90
|
-
```yaml
|
91
|
-
suites:
|
92
|
-
- name: default
|
93
|
-
manifest: foobar.pp
|
94
|
-
```
|
95
|
-
### Per-suite Structure
|
96
|
-
|
97
|
-
It can be beneficial to keep different Puppet layouts for different suites. Rather than having to specify the manifest, modules, etc for each suite, you can create the following directory structure and they will automatically be found:
|
98
|
-
|
99
|
-
$kitchen_root/puppet/$suite_name/manifests
|
100
|
-
$kitchen_root/puppet/$suite_name/modules
|
101
|
-
$kitchen_root/puppet/$suite_name/hiera
|
102
|
-
$kitchen_root/puppet/$suite_name/hiera.yaml
|
103
|
-
$kitchen_root/puppet/$suite_name/Puppetfile
|
104
|
-
|
105
|
-
### Puppet Version
|
106
|
-
When specifying a puppet version, you must use this format: "3.6.2-1puppetlabs1". I have
|
107
|
-
no idea why Puppet versioned their repository with a trailing
|
108
|
-
"-1puppetlabs1", but there it is.
|
109
|
-
|
110
|
-
|
111
|
-
# Puppet Agent Provisioner Options
|
112
|
-
|
113
|
-
key | default value | Notes
|
114
|
-
----|---------------|--------
|
115
|
-
puppet_version | "latest"| desired version, affects apt installs.
|
116
|
-
puppet_platform | naively tries to determine | OS platform of server
|
117
|
-
require_puppet_repo | true | Set if using a puppet install from yum or apt repo
|
118
|
-
puppet_apt_repo | "http://apt.puppetlabs.com/puppetlabs-release-precise.deb"| apt repo
|
119
|
-
puppet_yum_repo | "https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm"| yum repo
|
120
|
-
require_puppet_omnibus | false | Set if using omnibus puppet install
|
121
|
-
puppet_omnibus_url | | omnibus puppet install location.
|
122
|
-
puppet_omnibus_remote_path | "/opt/puppet" | Server Installation location of an omnibus puppet install.
|
123
|
-
puppet_detailed_exitcodes | nil | Provide transaction information via exit codes.
|
124
|
-
puppet_logdest | nil | Where to send messages. Choose between syslog, the console, and a log file.
|
125
|
-
puppet_masterport | nil | The port on which to contact the puppet master.
|
126
|
-
puppet_test | false | Enable the most common options used for testing.
|
127
|
-
puppet_onetime | true | Run the configuration once.
|
128
|
-
puppet_no_daemonize | true | Do not send the process into the background.
|
129
|
-
puppet_server | nil | will default to 'puppet'. Useful for interactively running when used with the --no-daemonize option.
|
130
|
-
puppet_waitforcert | '0' | Time to wait for certificate if agent does not yet have certificates
|
131
|
-
puppet_certname | nil | Set the certname (unique ID) of the client
|
132
|
-
puppet_digest | nil | Change the certificate fingerprinting digest algorithm. The default is SHA256
|
133
|
-
puppet_debug| false| Enable full debugging logging on puppet run
|
134
|
-
puppet_verbose| false| Extra information logging on puppet run
|
135
|
-
puppet_noop| false| puppet runs in a no-op or dry-run mode
|
136
|
-
update_package_repos| true| update OS repository metadata
|
137
|
-
custom_facts| Hash.new | Hash to set the puppet facts before running puppet apply
|
138
|
-
chef_bootstrap_url |"https://www.getchef.com/chef/install.sh"| the chef (needed for busser to run tests)
|
139
|
-
puppet_agent_command | nil | Overwrite the puppet agent command. Needs "sudo -E puppet agent" as a prefix.
|
140
|
-
require_chef_for_busser | true | Install chef as currently needed by busser to run tests. NOTE: kitchen 1.4 only requires ruby to run busser so this is not required.
|
141
|
-
puppet_config_path | | path of custom puppet.conf file
|
142
|
-
http_proxy | nil | use http proxy when installing puppet and packages
|
143
|
-
|
144
|
-
|
145
|
-
NOTE: Puppet Collections Support not in puppet agent yet
|
146
|
-
|
147
|
-
## Puppet Agent Configuring Provisioner Options
|
148
|
-
|
149
|
-
The provisioner can be configured globally or per suite, global settings act as defaults for all suites, you can then customise per suite, for example:
|
150
|
-
|
151
|
-
```yaml
|
152
|
-
---
|
153
|
-
driver:
|
154
|
-
name: vagrant
|
155
|
-
|
156
|
-
provisioner:
|
157
|
-
name: puppet_agent
|
158
|
-
puppet_debug: true
|
159
|
-
puppet_verbose: true
|
160
|
-
puppet_server: puppetmaster-nocm-ubuntu-1204
|
161
|
-
|
162
|
-
platforms:
|
163
|
-
- name: nocm_ubuntu-12.04
|
164
|
-
driver_plugin: vagrant
|
165
|
-
driver_config:
|
166
|
-
box: nocm_ubuntu-12.04
|
167
|
-
box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
|
168
|
-
|
169
|
-
suites:
|
170
|
-
- name: default
|
171
|
-
```
|
172
|
-
|
173
|
-
**NOTE:** With Test-Kitchen 1.4 you not longer need chef install to run the tests. You just need ruby installed version 1.9 or higher and also add to the .kitchen.yml file
|
174
|
-
|
175
|
-
```yaml
|
176
|
-
verifier:
|
177
|
-
ruby_bindir: '/usr/bin'
|
178
|
-
```
|
179
|
-
where /usr/bin is the location of the ruby command.
|
180
|
-
|
181
|
-
In this example, vagrant will download a box for ubuntu 1204 with no configuration management installed, then install the latest puppet and run puppet agent against a puppet master at puppetmaster-nocm-ubuntu-1204
|
182
|
-
|
183
|
-
NOTE: It is important that the server can resolve the hostname ip address of the puppetmaster, in this case puppetmaster-nocm-ubuntu-1204
|
184
|
-
and the puppetmaster must be able to resolve the hostname ip address address of the hostname of the node running puppet agent.
|
185
|
-
This can be done by settings in the /etc/hosts files before running puppet.
|
186
|
-
|
187
|
-
NOTE: For testing it is possible to set the puppetmaster to autosign the certificate of a node by created a file /etc/puppet/autosign.conf that contains an *.
|
188
|
-
|
189
|
-
|
190
|
-
To override a setting at the suite-level, specify the setting name under the suite:
|
191
|
-
|
192
|
-
```yaml
|
193
|
-
suites:
|
194
|
-
- name: default
|
195
|
-
manifest: foobar.pp
|
196
|
-
```
|
1
|
+
|
2
|
+
# Puppet Apply Provisioner Options
|
3
|
+
|
4
|
+
key | default value | Notes
|
5
|
+
----|---------------|--------
|
6
|
+
puppet_version | "latest"| desired version, affects apt installs.
|
7
|
+
puppet_platform | naively tries to determine | OS platform of server
|
8
|
+
require_puppet_repo | true | Set if using a puppet install from yum or apt repo
|
9
|
+
puppet_apt_repo | "http://apt.puppetlabs.com/puppetlabs-release-precise.deb"| apt repo
|
10
|
+
puppet_yum_repo | "https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm"| yum repo
|
11
|
+
require_puppet_collections | false | Set if using puppet collections install (Puppet v4)
|
12
|
+
puppet_yum_collections_repo | "http://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm" | yum collections repo
|
13
|
+
puppet_apt_collections_repo | "http://apt.puppetlabs.com/puppetlabs-release-pc1-wheezy.deb" | apt collections repo
|
14
|
+
puppet_coll_remote_path | "/opt/puppetlabs" | Server Installation location of a puppet collections install.
|
15
|
+
puppet_detailed_exitcodes | nil | Provide transaction information via exit codes.
|
16
|
+
manifests_path | | puppet repo manifests directory
|
17
|
+
manifest | 'site.pp' | manifest for puppet apply to run
|
18
|
+
modules_path | | puppet repo manifests directory
|
19
|
+
files_path | | directory to place at /tmp/kitchen/files
|
20
|
+
fileserver_config_path | | file to place fileserver.conf
|
21
|
+
hiera_config_path | | path to hiera.yaml
|
22
|
+
hiera_data_path | | puppet repo hiera data directory
|
23
|
+
hiera_data_remote_path | "/var/lib/hiera" | Hiera data directory on server
|
24
|
+
puppet_debug| false| Enable full debugging logging on puppet run
|
25
|
+
puppet_verbose| false| Extra information logging on puppet run
|
26
|
+
puppet_noop| false| puppet runs in a no-op or dry-run mode
|
27
|
+
puppet_git_init | nil | initialize puppet from GIT repository, e.g. "git@github.com:example/puppet-repo.git"
|
28
|
+
puppet_git_pr | nil | checkout specific Pull Request from repository specified in puppet_git_init, e.g. "324"
|
29
|
+
update_package_repos| true| update OS repository metadata
|
30
|
+
custom_facts| Hash.new | Hash to set the puppet facts before running puppet apply
|
31
|
+
install_custom_facts| false | Install custom facts to yaml file at "/tmp/kitchen/facter/kitchen.yaml"
|
32
|
+
chef_bootstrap_url |"https://www.getchef.com/chef/install.sh"| the chef (needed for busser to run tests) NOTE: kitchen 1.4 only requires ruby to run busser so this is not required.
|
33
|
+
puppetfile_path | | Path to Puppetfile
|
34
|
+
puppet_apply_command | nil | Overwrite the puppet apply command. Needs "sudo -E puppet apply" as a prefix.
|
35
|
+
require_chef_for_busser | true | Install chef as currently needed by busser to run tests
|
36
|
+
resolve_with_librarian_puppet | true | Use librarian_puppet to resolve modules if a Puppetfile is found
|
37
|
+
librarian_puppet_ssl_file | nil | ssl certificate file for librarian-puppet
|
38
|
+
puppet_config_path | | path of custom puppet.conf file
|
39
|
+
puppet_environment | nil | puppet environment for running puppet apply (Must set if using Puppet v4)
|
40
|
+
remove_puppet_repo | false | remove copy of puppet repository and puppet configuration on server after running puppet
|
41
|
+
hiera_eyaml | false | use hiera-eyaml to encrypt hiera data
|
42
|
+
hiera_eyaml_key_remote_path | "/etc/puppet/secure/keys" | directory of hiera-eyaml keys on server
|
43
|
+
hiera_eyaml_key_path | "hiera_keys" | directory of hiera-eyaml keys on workstation
|
44
|
+
hiera_deep_merge | false | install the deep_merge gem to support hiera deep merge mode
|
45
|
+
facter_file | nil | yaml file of custom facter_files to be provided to the puppet-apply command
|
46
|
+
http_proxy | nil | use http proxy when installing puppet, packages and running puppet
|
47
|
+
https_proxy | nil | use https proxy when installing puppet, packages and running puppet
|
48
|
+
puppet_logdest | nil | _Array_ of log destinations. Include 'console' if wanted
|
49
|
+
|
50
|
+
|
51
|
+
## Puppet Apply Configuring Provisioner Options
|
52
|
+
|
53
|
+
The provisioner can be configured globally or per suite, global settings act as defaults for all suites, you can then customise per suite, for example:
|
54
|
+
|
55
|
+
```yaml
|
56
|
+
---
|
57
|
+
driver:
|
58
|
+
name: vagrant
|
59
|
+
|
60
|
+
provisioner:
|
61
|
+
name: puppet_apply
|
62
|
+
manifests_path: /repository/puppet_repo/manifests
|
63
|
+
modules_path: /repository/puppet_repo/modules-mycompany
|
64
|
+
hiera_data_path: /repository/puppet_repo/hieradata
|
65
|
+
|
66
|
+
platforms:
|
67
|
+
- name: nocm_ubuntu-12.04
|
68
|
+
driver_plugin: vagrant
|
69
|
+
driver_config:
|
70
|
+
box: nocm_ubuntu-12.04
|
71
|
+
box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
|
72
|
+
|
73
|
+
suites:
|
74
|
+
- name: default
|
75
|
+
```
|
76
|
+
|
77
|
+
**NOTE:** With Test-Kitchen 1.4 you not longer need chef install to run the tests. You just need ruby installed version 1.9 or higher and also add to the .kitchen.yml file
|
78
|
+
|
79
|
+
```yaml
|
80
|
+
verifier:
|
81
|
+
ruby_bindir: '/usr/bin'
|
82
|
+
```
|
83
|
+
where /usr/bin is the location of the ruby command.
|
84
|
+
|
85
|
+
in this example, vagrant will download a box for ubuntu 1204 with no configuration management installed, then install the
|
86
|
+
latest puppet and puppet apply against a puppet repo from the /repository/puppet_repo directory using the defailt manifest site.pp
|
87
|
+
|
88
|
+
To override a setting at the suite-level, specify the setting name under the suite:
|
89
|
+
|
90
|
+
```yaml
|
91
|
+
suites:
|
92
|
+
- name: default
|
93
|
+
manifest: foobar.pp
|
94
|
+
```
|
95
|
+
### Per-suite Structure
|
96
|
+
|
97
|
+
It can be beneficial to keep different Puppet layouts for different suites. Rather than having to specify the manifest, modules, etc for each suite, you can create the following directory structure and they will automatically be found:
|
98
|
+
|
99
|
+
$kitchen_root/puppet/$suite_name/manifests
|
100
|
+
$kitchen_root/puppet/$suite_name/modules
|
101
|
+
$kitchen_root/puppet/$suite_name/hiera
|
102
|
+
$kitchen_root/puppet/$suite_name/hiera.yaml
|
103
|
+
$kitchen_root/puppet/$suite_name/Puppetfile
|
104
|
+
|
105
|
+
### Puppet Version
|
106
|
+
When specifying a puppet version, you must use this format: "3.6.2-1puppetlabs1". I have
|
107
|
+
no idea why Puppet versioned their repository with a trailing
|
108
|
+
"-1puppetlabs1", but there it is.
|
109
|
+
|
110
|
+
|
111
|
+
# Puppet Agent Provisioner Options
|
112
|
+
|
113
|
+
key | default value | Notes
|
114
|
+
----|---------------|--------
|
115
|
+
puppet_version | "latest"| desired version, affects apt installs.
|
116
|
+
puppet_platform | naively tries to determine | OS platform of server
|
117
|
+
require_puppet_repo | true | Set if using a puppet install from yum or apt repo
|
118
|
+
puppet_apt_repo | "http://apt.puppetlabs.com/puppetlabs-release-precise.deb"| apt repo
|
119
|
+
puppet_yum_repo | "https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm"| yum repo
|
120
|
+
require_puppet_omnibus | false | Set if using omnibus puppet install
|
121
|
+
puppet_omnibus_url | | omnibus puppet install location.
|
122
|
+
puppet_omnibus_remote_path | "/opt/puppet" | Server Installation location of an omnibus puppet install.
|
123
|
+
puppet_detailed_exitcodes | nil | Provide transaction information via exit codes.
|
124
|
+
puppet_logdest | nil | Where to send messages. Choose between syslog, the console, and a log file.
|
125
|
+
puppet_masterport | nil | The port on which to contact the puppet master.
|
126
|
+
puppet_test | false | Enable the most common options used for testing.
|
127
|
+
puppet_onetime | true | Run the configuration once.
|
128
|
+
puppet_no_daemonize | true | Do not send the process into the background.
|
129
|
+
puppet_server | nil | will default to 'puppet'. Useful for interactively running when used with the --no-daemonize option.
|
130
|
+
puppet_waitforcert | '0' | Time to wait for certificate if agent does not yet have certificates
|
131
|
+
puppet_certname | nil | Set the certname (unique ID) of the client
|
132
|
+
puppet_digest | nil | Change the certificate fingerprinting digest algorithm. The default is SHA256
|
133
|
+
puppet_debug| false| Enable full debugging logging on puppet run
|
134
|
+
puppet_verbose| false| Extra information logging on puppet run
|
135
|
+
puppet_noop| false| puppet runs in a no-op or dry-run mode
|
136
|
+
update_package_repos| true| update OS repository metadata
|
137
|
+
custom_facts| Hash.new | Hash to set the puppet facts before running puppet apply
|
138
|
+
chef_bootstrap_url |"https://www.getchef.com/chef/install.sh"| the chef (needed for busser to run tests)
|
139
|
+
puppet_agent_command | nil | Overwrite the puppet agent command. Needs "sudo -E puppet agent" as a prefix.
|
140
|
+
require_chef_for_busser | true | Install chef as currently needed by busser to run tests. NOTE: kitchen 1.4 only requires ruby to run busser so this is not required.
|
141
|
+
puppet_config_path | | path of custom puppet.conf file
|
142
|
+
http_proxy | nil | use http proxy when installing puppet and packages
|
143
|
+
|
144
|
+
|
145
|
+
NOTE: Puppet Collections Support not in puppet agent yet
|
146
|
+
|
147
|
+
## Puppet Agent Configuring Provisioner Options
|
148
|
+
|
149
|
+
The provisioner can be configured globally or per suite, global settings act as defaults for all suites, you can then customise per suite, for example:
|
150
|
+
|
151
|
+
```yaml
|
152
|
+
---
|
153
|
+
driver:
|
154
|
+
name: vagrant
|
155
|
+
|
156
|
+
provisioner:
|
157
|
+
name: puppet_agent
|
158
|
+
puppet_debug: true
|
159
|
+
puppet_verbose: true
|
160
|
+
puppet_server: puppetmaster-nocm-ubuntu-1204
|
161
|
+
|
162
|
+
platforms:
|
163
|
+
- name: nocm_ubuntu-12.04
|
164
|
+
driver_plugin: vagrant
|
165
|
+
driver_config:
|
166
|
+
box: nocm_ubuntu-12.04
|
167
|
+
box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
|
168
|
+
|
169
|
+
suites:
|
170
|
+
- name: default
|
171
|
+
```
|
172
|
+
|
173
|
+
**NOTE:** With Test-Kitchen 1.4 you not longer need chef install to run the tests. You just need ruby installed version 1.9 or higher and also add to the .kitchen.yml file
|
174
|
+
|
175
|
+
```yaml
|
176
|
+
verifier:
|
177
|
+
ruby_bindir: '/usr/bin'
|
178
|
+
```
|
179
|
+
where /usr/bin is the location of the ruby command.
|
180
|
+
|
181
|
+
In this example, vagrant will download a box for ubuntu 1204 with no configuration management installed, then install the latest puppet and run puppet agent against a puppet master at puppetmaster-nocm-ubuntu-1204
|
182
|
+
|
183
|
+
NOTE: It is important that the server can resolve the hostname ip address of the puppetmaster, in this case puppetmaster-nocm-ubuntu-1204
|
184
|
+
and the puppetmaster must be able to resolve the hostname ip address address of the hostname of the node running puppet agent.
|
185
|
+
This can be done by settings in the /etc/hosts files before running puppet.
|
186
|
+
|
187
|
+
NOTE: For testing it is possible to set the puppetmaster to autosign the certificate of a node by created a file /etc/puppet/autosign.conf that contains an *.
|
188
|
+
|
189
|
+
|
190
|
+
To override a setting at the suite-level, specify the setting name under the suite:
|
191
|
+
|
192
|
+
```yaml
|
193
|
+
suites:
|
194
|
+
- name: default
|
195
|
+
manifest: foobar.pp
|
196
|
+
```
|