kitchen-puppet 1.41.2 → 1.42.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,265 +1,284 @@
1
-
2
- # Puppet Apply Provisioner Options
3
-
4
- key | default value | Notes
5
- ----|---------------|--------
6
- puppet_version | "latest"| desired version, affects apt installs.
7
- facter_version | "latest"| desired version, affects apt installs.
8
- platform | platform_name kitchen.yml parameter | OS platform of server
9
- hiera_version | "latest"| desired version, affects apt installs.
10
- install_hiera | false | Installs `hiera-puppet` package. Not needed for puppet > 3.x.x
11
- hiera_package | 'hiera-puppet' | Only used if `install_hiera` is set
12
- require_puppet_repo | true | Set if using a puppet install from yum or apt repo
13
- puppet_apt_repo | "http://apt.puppetlabs.com/puppetlabs-release-precise.deb"| apt repo Ubuntu12
14
- _for Ubuntu15 change to_ | "http://apt.puppetlabs.com/puppetlabs-release-jessie.deb" |
15
- puppet_yum_repo | "https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm"| yum repo RH/Centos6
16
- _for RH/Centos7 change to_ | "https://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm" |
17
- require_puppet_collections | false | Set if using puppet collections install (Puppet v4)
18
- puppet_yum_collections_repo | "http://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm" | yum collections repo RH/Centos6
19
- _for RH/Centos7 change to_ | "https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm" |
20
- puppet_apt_collections_repo | "http://apt.puppetlabs.com/puppetlabs-release-pc1-wheezy.deb" | apt collections repo
21
- _for Ubuntu15 change to_ | "http://apt.puppetlabs.com/puppetlabs-release-pc1-jessie.deb" |
22
- puppet_coll_remote_path | "/opt/puppetlabs" | Server Installation location of a puppet collections install.
23
- puppet_detailed_exitcodes | nil | Provide transaction information via exit codes. See `--detailed-exitcodes` section of `puppet help apply`
24
- manifests_path | | puppet repo manifests directory
25
- manifest | 'site.pp' | manifest for puppet apply to run
26
- modules_path | | puppet repo manifests directory. Can be multiple directories separated by colons and then they will be merged
27
- files_path | | directory to place at /tmp/kitchen/files
28
- fileserver_config_path | | file to place fileserver.conf
29
- hiera_config_path | | path to hiera.yaml
30
- hiera_data_path | | puppet repo hiera data directory
31
- hiera_data_remote_path | "/var/lib/hiera" | Hiera data directory on server
32
- puppet_debug| false| Enable full debugging logging on puppet run
33
- puppet_verbose| false| Extra information logging on puppet run
34
- puppet_noop| false| puppet runs in a no-op or dry-run mode
35
- puppet_git_init | nil | initialize puppet from GIT repository, e.g. "git@github.com:example/puppet-repo.git"
36
- puppet_git_pr | nil | checkout specific Pull Request from repository specified in puppet_git_init, e.g. "324"
37
- update_package_repos| true| update OS repository metadata
38
- custom_facts| Hash.new | Hash to set the puppet facts before running puppet apply
39
- install_custom_facts| false | Install custom facts to yaml file at "/tmp/kitchen/facter/kitchen.rb"
40
- facter_file | nil | yaml file of custom facter_files to be provided to the puppet-apply command
41
- 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.
42
- puppetfile_path | | Path to Puppetfile
43
- puppet_apply_command | nil | Overwrite the puppet apply command. Needs "sudo -E puppet apply" as a prefix.
44
- require_chef_for_busser | true | Install chef as currently needed by busser to run tests
45
- resolve_with_librarian_puppet | true | Use librarian_puppet to resolve modules if a Puppetfile is found
46
- librarian_puppet_ssl_file | nil | ssl certificate file for librarian-puppet
47
- puppet_config_path | | path of custom puppet.conf file
48
- puppet_environment | nil | puppet environment for running puppet apply (Must set if using Puppet v4)
49
- remove_puppet_repo | false | remove copy of puppet repository and puppet configuration on server after running puppet
50
- hiera_eyaml | false | use hiera-eyaml to encrypt hiera data
51
- hiera_eyaml_key_remote_path | "/etc/puppet/secure/keys" | directory of hiera-eyaml keys on server
52
- hiera_eyaml_key_path | "hiera_keys" | directory of hiera-eyaml keys on workstation
53
- hiera_deep_merge | false | install the deep_merge gem to support hiera deep merge mode
54
- http_proxy | nil | use http proxy when installing puppet, packages and running puppet
55
- https_proxy | nil | use https proxy when installing puppet, packages and running puppet
56
- puppet_logdest | nil | _Array_ of log destinations. Include 'console' if wanted
57
- custom_options | | custom options to add to puppet apply command.
58
- custom_install_command | nil | Custom shell command to be used at install stage. Can be multiline. See examples below.
59
- puppet_whitelist_exit_code | nil | Whitelist exit code expected from puppet run. Intended to be used together with `puppet_detailed_exitcodes`.
60
- require_puppet_omnibus | false | Set if using omnibus puppet install
61
- puppet_omnibus_url | https://raw.githubusercontent.com/ petems/puppet-install-shell/ master/install_puppet.sh | omnibus puppet v3 install location.
62
- _for puppet v4 change to_ | https://raw.githubusercontent.com/ petems/puppet-install-shell/ master/install_puppet_agent.sh |
63
- puppet_enc | | path for external node classifier script
64
- puppet_no_sudo | false | allow puppet command to run without sudo if required
65
- ignore_spec_fixtures | false | don't copy spec/fixtures to avoid problems with symlinks
66
- ignored_paths_from_root | [] | allow extra paths to be ignored when copying from puppet repository
67
-
68
- ## Puppet Apply Configuring Provisioner Options
69
-
70
- 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:
71
-
72
- ```yaml
73
- ---
74
- driver:
75
- name: vagrant
76
-
77
- provisioner:
78
- name: puppet_apply
79
- manifests_path: /repository/puppet_repo/manifests
80
- modules_path: /repository/puppet_repo/modules-mycompany
81
- hiera_data_path: /repository/puppet_repo/hieradata
82
-
83
- platforms:
84
- - name: nocm_ubuntu-12.04
85
- driver_plugin: vagrant
86
- driver_config:
87
- box: nocm_ubuntu-12.04
88
- box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
89
-
90
- suites:
91
- - name: default
92
- ```
93
-
94
- **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
95
-
96
- ```yaml
97
- verifier:
98
- ruby_bindir: '/usr/bin'
99
- ```
100
- where /usr/bin is the location of the ruby command.
101
-
102
- in this example, vagrant will download a box for ubuntu 1204 with no configuration management installed, then install the
103
- latest puppet and puppet apply against a puppet repo from the /repository/puppet_repo directory using the defailt manifest site.pp
104
-
105
- To override a setting at the suite-level, specify the setting name under the suite:
106
-
107
- ```yaml
108
- suites:
109
- - name: default
110
- provisioner:
111
- manifest: foobar.pp
112
- ```
113
-
114
- #### custom_install_command example usage
115
-
116
- * One liner
117
- ```yaml
118
- custom_install_command: yum install -y git
119
- ```
120
- * Multiple lines, a.k.a embed shell script
121
- ```yaml
122
- custom_install_command: |
123
- command1
124
- command2
125
- ```
126
- * Multiple lines join without new line
127
- ```yaml
128
- custom_install_command: >
129
- command1 &&
130
- command2
131
- ```
132
-
133
- ### Per-suite Structure
134
-
135
- 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:
136
-
137
- $kitchen_root/puppet/$suite_name/manifests
138
- $kitchen_root/puppet/$suite_name/modules
139
- $kitchen_root/puppet/$suite_name/hiera
140
- $kitchen_root/puppet/$suite_name/hiera.yaml
141
- $kitchen_root/puppet/$suite_name/Puppetfile
142
-
143
- ### Puppet Version
144
- When specifying a puppet version, you must use this format: "3.6.2-1puppetlabs1". I have
145
- no idea why Puppet versioned their repository with a trailing
146
- "-1puppetlabs1", but there it is.
147
-
148
-
149
- # Puppet Agent Provisioner Options
150
-
151
- key | default value | Notes
152
- ----|---------------|--------
153
- puppet_version | "latest"| desired version, affects apt installs.
154
- facter_version | "latest"| desired version, affects apt installs.
155
- platform | platform_name kitchen.yml parameter | OS platform of server
156
- require_puppet_repo | true | Set if using a puppet install from yum or apt repo
157
- puppet_apt_repo | "http://apt.puppetlabs.com/puppetlabs-release-precise.deb"| apt repo
158
- puppet_yum_repo | "https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm"| yum repo
159
- require_puppet_omnibus | false | Set if using omnibus puppet install
160
- puppet_omnibus_url | | omnibus puppet install location.
161
- puppet_omnibus_remote_path | "/opt/puppet" | Server Installation location of an omnibus puppet install.
162
- puppet_detailed_exitcodes | nil | Provide transaction information via exit codes.
163
- puppet_logdest | nil | Where to send messages. Choose between syslog, the console, and a log file.
164
- puppet_masterport | nil | The port on which to contact the puppet master.
165
- puppet_test | false | Enable the most common options used for testing.
166
- puppet_onetime | true | Run the configuration once.
167
- puppet_no_daemonize | true | Do not send the process into the background.
168
- puppet_server | nil | will default to 'puppet'. Useful for interactively running when used with the --no-daemonize option.
169
- puppet_waitforcert | '0' | Time to wait for certificate if agent does not yet have certificates
170
- puppet_certname | nil | Set the certname (unique ID) of the client
171
- puppet_digest | nil | Change the certificate fingerprinting digest algorithm. The default is SHA256
172
- puppet_debug| false| Enable full debugging logging on puppet run
173
- puppet_verbose| false| Extra information logging on puppet run
174
- puppet_noop| false| puppet runs in a no-op or dry-run mode
175
- update_package_repos| true| update OS repository metadata
176
- custom_facts| Hash.new | Hash to set the puppet facts before running puppet apply
177
- facterlib | nil | Path for dynamic fact generation, e.g. /etc/puppet/facter . See https://docs.puppetlabs.com/facter/2.2/custom_facts.html
178
- chef_bootstrap_url |"https://www.getchef.com/chef/install.sh"| the chef (needed for busser to run tests)
179
- puppet_agent_command | nil | Overwrite the puppet agent command. Needs "sudo -E puppet agent" as a prefix.
180
- 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.
181
- puppet_config_path | | path of custom puppet.conf file
182
- http_proxy | nil | use http proxy when installing puppet and packages
183
- ignore_spec_fixtures | | ignore spec/fixtures directory
184
-
185
- NOTE: Puppet Collections Support not in puppet agent yet
186
-
187
- ## Puppet Agent Configuring Provisioner Options
188
-
189
- 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:
190
-
191
- ```yaml
192
- ---
193
- driver:
194
- name: vagrant
195
-
196
- provisioner:
197
- name: puppet_agent
198
- puppet_debug: true
199
- puppet_verbose: true
200
- puppet_server: puppetmaster-nocm-ubuntu-1204
201
-
202
- platforms:
203
- - name: nocm_ubuntu-12.04
204
- driver_plugin: vagrant
205
- driver_config:
206
- box: nocm_ubuntu-12.04
207
- box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
208
-
209
- suites:
210
- - name: default
211
- ```
212
-
213
- **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
214
-
215
- ```yaml
216
- verifier:
217
- ruby_bindir: '/usr/bin'
218
- ```
219
- where /usr/bin is the location of the ruby command.
220
-
221
- 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
222
-
223
- NOTE: It is important that the server can resolve the hostname ip address of the puppetmaster, in this case puppetmaster-nocm-ubuntu-1204
224
- and the puppetmaster must be able to resolve the hostname ip address address of the hostname of the node running puppet agent.
225
- This can be done by settings in the /etc/hosts files before running puppet.
226
-
227
- 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 *.
228
-
229
-
230
- To override a setting at the suite-level, specify the setting name under the suite:
231
-
232
- ```yaml
233
- suites:
234
- - name: default
235
- provisioner:
236
- manifest: foobar.pp
237
- ```
238
-
239
- ## Custom ServerSpec or Beaker Invocation
240
-
241
- Instead of using the busser use a custom serverspec invocation using [shell verifier](https://github.com/higanworks/kitchen-verifier-shell) to call it.
242
- With such setup there is no dependency on busser and any other chef library.
243
-
244
- Also you can specify you tests in a different directory structure or even call [beaker](https://github.com/puppetlabs/beaker) instead of server spec and have tests in beaker structure
245
-
246
- Using a structure like
247
- ```yaml
248
- verifier:
249
- name: shell
250
- remote_exec: true
251
- command: |
252
- sudo -s <<SERVERSPEC
253
- cd /opt/gdc/serverspec-core
254
- export SERVERSPEC_ENV=$EC2DATA_ENVIRONMENT
255
- export SERVERSPEC_BACKEND=exec
256
- serverspec junit=true tag=~skip_in_kitchen check:role:$EC2DATA_TYPE
257
- SERVERSPEC
258
- ```
259
-
260
- where `serverspec` is a wrapper around `rake` invocation.
261
- Use a `Rakefile` similar to one in https://github.com/vincentbernat/serverspec-example.
262
-
263
- With such approach we can achieve flexibility of running same test suite both in test kitchen and actual, even production, instances.
264
-
265
- Beware: kitchen-shell-verifier is not yet merged into test-kitchen upstream so using separate gem is unavoidable so far
1
+
2
+ # Puppet Apply Install Options
3
+
4
+ Kitchen-puppet is very flexible in how it installs puppet:
5
+
6
+ It installs it in the following order:
7
+
8
+ * if require_puppet_omnibus is set to true
9
+ Installs using the omnibus_puppet script and passes the puppet_version if specied as -v option.
10
+ * If require_puppet_collections is set to true
11
+ Install from the puppet collection.
12
+ This is required if you wish to install puppet version 4.
13
+ You get the version of puppet in the collection. To influence which puppet version is install modify either
14
+ puppet_yum_collections_repo
15
+ puppet_apt_collections_repo
16
+ to an new collection. At time of writing there was only one collection PC1.
17
+ * if require_puppet_repo is set to true (the default)
18
+ Installs from the operation system repository with the puppet version that is in the particular repository.
19
+
20
+ # Puppet Apply Provisioner Options
21
+
22
+ key | default value | Notes
23
+ ----|---------------|--------
24
+ puppet_version | "latest"| desired version, affects apt installs.
25
+ facter_version | "latest"| desired version, affects apt installs.
26
+ platform | platform_name kitchen.yml parameter | OS platform of server
27
+ hiera_version | "latest"| desired version, affects apt installs.
28
+ install_hiera | false | Installs `hiera-puppet` package. Not needed for puppet > 3.x.x
29
+ hiera_package | 'hiera-puppet' | Only used if `install_hiera` is set
30
+ require_puppet_repo | true | Set if using a puppet install from yum or apt repo
31
+ puppet_apt_repo | "http://apt.puppetlabs.com/puppetlabs-release-precise.deb"| apt repo Ubuntu12
32
+ _for Ubuntu15 change to_ | "http://apt.puppetlabs.com/puppetlabs-release-jessie.deb" |
33
+ puppet_yum_repo | "https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm"| yum repo RH/Centos6
34
+ _for RH/Centos7 change to_ | "https://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm" |
35
+ require_puppet_collections | false | Set if using puppet collections install (Puppet v4)
36
+ puppet_yum_collections_repo | "http://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm" | yum collections repo RH/Centos6
37
+ _for RH/Centos7 change to_ | "https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm" |
38
+ puppet_apt_collections_repo | "http://apt.puppetlabs.com/puppetlabs-release-pc1-wheezy.deb" | apt collections repo
39
+ _for Ubuntu15 change to_ | "http://apt.puppetlabs.com/puppetlabs-release-pc1-jessie.deb" |
40
+ puppet_coll_remote_path | "/opt/puppetlabs" | Server Installation location of a puppet collections install.
41
+ puppet_detailed_exitcodes | nil | Provide transaction information via exit codes. See `--detailed-exitcodes` section of `puppet help apply`
42
+ manifests_path | | puppet repo manifests directory
43
+ manifest | 'site.pp' | manifest for puppet apply to run
44
+ modules_path | | puppet repo manifests directory. Can be multiple directories separated by colons and then they will be merged
45
+ files_path | | directory to place at /tmp/kitchen/files
46
+ fileserver_config_path | | file to place fileserver.conf
47
+ hiera_config_path | | path to hiera.yaml
48
+ hiera_data_path | | puppet repo hiera data directory
49
+ hiera_data_remote_path | "/var/lib/hiera" | Hiera data directory on server
50
+ puppet_debug| false| Enable full debugging logging on puppet run
51
+ puppet_verbose| false| Extra information logging on puppet run
52
+ puppet_noop| false| puppet runs in a no-op or dry-run mode
53
+ puppet_git_init | nil | initialize puppet from GIT repository, e.g. "git@github.com:example/puppet-repo.git"
54
+ puppet_git_pr | nil | checkout specific Pull Request from repository specified in puppet_git_init, e.g. "324"
55
+ update_package_repos| true| update OS repository metadata
56
+ custom_facts| Hash.new | Hash to set the puppet facts before running puppet apply
57
+ install_custom_facts| false | Install custom facts to yaml file at "/tmp/kitchen/facter/kitchen.rb"
58
+ facter_file | nil | yaml file of custom facter_files to be provided to the puppet-apply command
59
+ 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.
60
+ puppetfile_path | | Path to Puppetfile
61
+ puppet_apply_command | nil | Overwrite the puppet apply command. Needs "sudo -E puppet apply" as a prefix.
62
+ require_chef_for_busser | true | Install chef as currently needed by busser to run tests
63
+ resolve_with_librarian_puppet | true | Use librarian_puppet to resolve modules if a Puppetfile is found
64
+ librarian_puppet_ssl_file | nil | ssl certificate file for librarian-puppet
65
+ puppet_config_path | | path of custom puppet.conf file
66
+ puppet_environment | nil | puppet environment for running puppet apply (Must set if using Puppet v4)
67
+ remove_puppet_repo | false | remove copy of puppet repository and puppet configuration on server after running puppet
68
+ hiera_eyaml | false | use hiera-eyaml to encrypt hiera data
69
+ hiera_eyaml_key_remote_path | "/etc/puppet/secure/keys" | directory of hiera-eyaml keys on server
70
+ hiera_eyaml_key_path | "hiera_keys" | directory of hiera-eyaml keys on workstation
71
+ hiera_deep_merge | false | install the deep_merge gem to support hiera deep merge mode
72
+ http_proxy | nil | use http proxy when installing puppet, packages and running puppet
73
+ https_proxy | nil | use https proxy when installing puppet, packages and running puppet
74
+ puppet_logdest | nil | _Array_ of log destinations. Include 'console' if wanted
75
+ custom_options | | custom options to add to puppet apply command.
76
+ custom_pre_install_command | nil | Custom shell command to be used at beginning of install stage. Can be multiline.
77
+ custom_install_command | nil | Custom shell command to be used at end of install stage. Can be multiline. See examples below.
78
+ puppet_whitelist_exit_code | nil | Whitelist exit code expected from puppet run. Intended to be used together with `puppet_detailed_exitcodes`.
79
+ require_puppet_omnibus | false | Set if using omnibus puppet install
80
+ puppet_omnibus_url | https://raw.githubusercontent.com/ petems/puppet-install-shell/ master/install_puppet.sh | omnibus puppet v3 install location.
81
+ _for puppet v4 change to_ | https://raw.githubusercontent.com/ petems/puppet-install-shell/ master/install_puppet_agent.sh |
82
+ puppet_enc | | path for external node classifier script
83
+ puppet_no_sudo | false | allow puppet command to run without sudo if required
84
+ ignore_spec_fixtures | false | don't copy spec/fixtures to avoid problems with symlinks
85
+ ignored_paths_from_root | [] | allow extra paths to be ignored when copying from puppet repository
86
+
87
+ ## Puppet Apply Configuring Provisioner Options
88
+
89
+ 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:
90
+
91
+ ```yaml
92
+ ---
93
+ driver:
94
+ name: vagrant
95
+
96
+ provisioner:
97
+ name: puppet_apply
98
+ manifests_path: /repository/puppet_repo/manifests
99
+ modules_path: /repository/puppet_repo/modules-mycompany
100
+ hiera_data_path: /repository/puppet_repo/hieradata
101
+
102
+ platforms:
103
+ - name: nocm_ubuntu-12.04
104
+ driver_plugin: vagrant
105
+ driver_config:
106
+ box: nocm_ubuntu-12.04
107
+ box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
108
+
109
+ suites:
110
+ - name: default
111
+ ```
112
+
113
+ **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
114
+
115
+ ```yaml
116
+ verifier:
117
+ ruby_bindir: '/usr/bin'
118
+ ```
119
+ where /usr/bin is the location of the ruby command.
120
+
121
+ in this example, vagrant will download a box for ubuntu 1204 with no configuration management installed, then install the
122
+ latest puppet and puppet apply against a puppet repo from the /repository/puppet_repo directory using the defailt manifest site.pp
123
+
124
+ To override a setting at the suite-level, specify the setting name under the suite:
125
+
126
+ ```yaml
127
+ suites:
128
+ - name: default
129
+ provisioner:
130
+ manifest: foobar.pp
131
+ ```
132
+
133
+ #### custom_install_command example usage
134
+
135
+ * One liner
136
+ ```yaml
137
+ custom_install_command: yum install -y git
138
+ ```
139
+ * Multiple lines, a.k.a embed shell script
140
+ ```yaml
141
+ custom_install_command: |
142
+ command1
143
+ command2
144
+ ```
145
+ * Multiple lines join without new line
146
+ ```yaml
147
+ custom_install_command: >
148
+ command1 &&
149
+ command2
150
+ ```
151
+
152
+ ### Per-suite Structure
153
+
154
+ 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:
155
+
156
+ $kitchen_root/puppet/$suite_name/manifests
157
+ $kitchen_root/puppet/$suite_name/modules
158
+ $kitchen_root/puppet/$suite_name/hiera
159
+ $kitchen_root/puppet/$suite_name/hiera.yaml
160
+ $kitchen_root/puppet/$suite_name/Puppetfile
161
+
162
+ ### Puppet Version
163
+ When specifying a puppet version, you must use this format: "3.6.2-1puppetlabs1". I have
164
+ no idea why Puppet versioned their repository with a trailing
165
+ "-1puppetlabs1", but there it is.
166
+
167
+
168
+ # Puppet Agent Provisioner Options
169
+
170
+ key | default value | Notes
171
+ ----|---------------|--------
172
+ puppet_version | "latest"| desired version, affects apt installs.
173
+ facter_version | "latest"| desired version, affects apt installs.
174
+ platform | platform_name kitchen.yml parameter | OS platform of server
175
+ require_puppet_repo | true | Set if using a puppet install from yum or apt repo
176
+ puppet_apt_repo | "http://apt.puppetlabs.com/puppetlabs-release-precise.deb"| apt repo
177
+ puppet_yum_repo | "https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm"| yum repo
178
+ require_puppet_omnibus | false | Set if using omnibus puppet install
179
+ puppet_omnibus_url | | omnibus puppet install location.
180
+ puppet_omnibus_remote_path | "/opt/puppet" | Server Installation location of an omnibus puppet install.
181
+ puppet_detailed_exitcodes | nil | Provide transaction information via exit codes.
182
+ puppet_logdest | nil | Where to send messages. Choose between syslog, the console, and a log file.
183
+ puppet_masterport | nil | The port on which to contact the puppet master.
184
+ puppet_test | false | Enable the most common options used for testing.
185
+ puppet_onetime | true | Run the configuration once.
186
+ puppet_no_daemonize | true | Do not send the process into the background.
187
+ puppet_server | nil | will default to 'puppet'. Useful for interactively running when used with the --no-daemonize option.
188
+ puppet_waitforcert | '0' | Time to wait for certificate if agent does not yet have certificates
189
+ puppet_certname | nil | Set the certname (unique ID) of the client
190
+ puppet_digest | nil | Change the certificate fingerprinting digest algorithm. The default is SHA256
191
+ puppet_debug| false| Enable full debugging logging on puppet run
192
+ puppet_verbose| false| Extra information logging on puppet run
193
+ puppet_noop| false| puppet runs in a no-op or dry-run mode
194
+ update_package_repos| true| update OS repository metadata
195
+ custom_facts| Hash.new | Hash to set the puppet facts before running puppet apply
196
+ facterlib | nil | Path for dynamic fact generation, e.g. /etc/puppet/facter . See https://docs.puppetlabs.com/facter/2.2/custom_facts.html
197
+ chef_bootstrap_url |"https://www.getchef.com/chef/install.sh"| the chef (needed for busser to run tests)
198
+ puppet_agent_command | nil | Overwrite the puppet agent command. Needs "sudo -E puppet agent" as a prefix.
199
+ 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.
200
+ puppet_config_path | | path of custom puppet.conf file
201
+ http_proxy | nil | use http proxy when installing puppet and packages
202
+ ignore_spec_fixtures | | ignore spec/fixtures directory
203
+
204
+ NOTE: Puppet Collections Support not in puppet agent yet
205
+
206
+ ## Puppet Agent Configuring Provisioner Options
207
+
208
+ 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:
209
+
210
+ ```yaml
211
+ ---
212
+ driver:
213
+ name: vagrant
214
+
215
+ provisioner:
216
+ name: puppet_agent
217
+ puppet_debug: true
218
+ puppet_verbose: true
219
+ puppet_server: puppetmaster-nocm-ubuntu-1204
220
+
221
+ platforms:
222
+ - name: nocm_ubuntu-12.04
223
+ driver_plugin: vagrant
224
+ driver_config:
225
+ box: nocm_ubuntu-12.04
226
+ box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
227
+
228
+ suites:
229
+ - name: default
230
+ ```
231
+
232
+ **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
233
+
234
+ ```yaml
235
+ verifier:
236
+ ruby_bindir: '/usr/bin'
237
+ ```
238
+ where /usr/bin is the location of the ruby command.
239
+
240
+ 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
241
+
242
+ NOTE: It is important that the server can resolve the hostname ip address of the puppetmaster, in this case puppetmaster-nocm-ubuntu-1204
243
+ and the puppetmaster must be able to resolve the hostname ip address address of the hostname of the node running puppet agent.
244
+ This can be done by settings in the /etc/hosts files before running puppet.
245
+
246
+ 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 *.
247
+
248
+
249
+ To override a setting at the suite-level, specify the setting name under the suite:
250
+
251
+ ```yaml
252
+ suites:
253
+ - name: default
254
+ provisioner:
255
+ manifest: foobar.pp
256
+ ```
257
+
258
+ ## Custom ServerSpec or Beaker Invocation
259
+
260
+ Instead of using the busser use a custom serverspec invocation using [shell verifier](https://github.com/higanworks/kitchen-verifier-shell) to call it.
261
+ With such setup there is no dependency on busser and any other chef library.
262
+
263
+ Also you can specify you tests in a different directory structure or even call [beaker](https://github.com/puppetlabs/beaker) instead of server spec and have tests in beaker structure
264
+
265
+ Using a structure like
266
+ ```yaml
267
+ verifier:
268
+ name: shell
269
+ remote_exec: true
270
+ command: |
271
+ sudo -s <<SERVERSPEC
272
+ cd /opt/gdc/serverspec-core
273
+ export SERVERSPEC_ENV=$EC2DATA_ENVIRONMENT
274
+ export SERVERSPEC_BACKEND=exec
275
+ serverspec junit=true tag=~skip_in_kitchen check:role:$EC2DATA_TYPE
276
+ SERVERSPEC
277
+ ```
278
+
279
+ where `serverspec` is a wrapper around `rake` invocation.
280
+ Use a `Rakefile` similar to one in https://github.com/vincentbernat/serverspec-example.
281
+
282
+ With such approach we can achieve flexibility of running same test suite both in test kitchen and actual, even production, instances.
283
+
284
+ Beware: kitchen-shell-verifier is not yet merged into test-kitchen upstream so using separate gem is unavoidable so far