kitchen-ansible 0.49.0 → 0.52.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +270 -270
- data/kitchen-ansible.gemspec +34 -35
- data/lib/kitchen-ansible/version.rb +6 -6
- data/lib/kitchen/provisioner/ansible/config.rb +206 -197
- data/lib/kitchen/provisioner/ansible/librarian.rb +78 -78
- data/lib/kitchen/provisioner/ansible/os.rb +84 -84
- data/lib/kitchen/provisioner/ansible/os/alpine.rb +42 -42
- data/lib/kitchen/provisioner/ansible/os/amazon.rb +42 -42
- data/lib/kitchen/provisioner/ansible/os/darwin.rb +37 -37
- data/lib/kitchen/provisioner/ansible/os/debian.rb +77 -75
- data/lib/kitchen/provisioner/ansible/os/fedora.rb +66 -60
- data/lib/kitchen/provisioner/ansible/os/freebsd.rb +34 -34
- data/lib/kitchen/provisioner/ansible/os/openbsd.rb +36 -36
- data/lib/kitchen/provisioner/ansible/os/redhat.rb +86 -80
- data/lib/kitchen/provisioner/ansible/os/suse.rb +44 -44
- data/lib/kitchen/provisioner/ansible_playbook.rb +1292 -1239
- data/provisioner_options.md +290 -268
- metadata +6 -7
data/provisioner_options.md
CHANGED
@@ -1,268 +1,290 @@
|
|
1
|
-
# Ansible Install Options
|
2
|
-
|
3
|
-
Kitchen-ansible is very flexible in how it installs ansible:
|
4
|
-
|
5
|
-
It installs it in the following order:
|
6
|
-
|
7
|
-
* if require_ansible_omnibus is set to true
|
8
|
-
|
9
|
-
Installs using the omnibus_ansible script specified in the ansible_omnibus_url parameter and passes the ansible_version if specied as -v option.
|
10
|
-
|
11
|
-
* If require_ansible_source is set to true
|
12
|
-
|
13
|
-
Install require packages and download the ansible source from github from master or from a branch specified in the parameter install_source_rev.
|
14
|
-
|
15
|
-
* if require_pip is set to true
|
16
|
-
|
17
|
-
Install require packages and then installs ansible using the python pip command and ansible version must be specified. This allows a specific version of ansible to be installed.
|
18
|
-
|
19
|
-
* if
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
if
|
123
|
-
```yaml
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
the
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
```
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
*
|
198
|
-
|
199
|
-
|
200
|
-
-
|
201
|
-
|
202
|
-
*
|
203
|
-
|
204
|
-
```
|
205
|
-
|
206
|
-
- data
|
207
|
-
```
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
```
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
```
|
1
|
+
# Ansible Install Options
|
2
|
+
|
3
|
+
Kitchen-ansible is very flexible in how it installs ansible:
|
4
|
+
|
5
|
+
It installs it in the following order:
|
6
|
+
|
7
|
+
* if require_ansible_omnibus is set to true
|
8
|
+
|
9
|
+
Installs using the omnibus_ansible script specified in the ansible_omnibus_url parameter and passes the ansible_version if specied as -v option.
|
10
|
+
|
11
|
+
* If require_ansible_source is set to true
|
12
|
+
|
13
|
+
Install require packages and download the ansible source from github from master or from a branch specified in the parameter install_source_rev.
|
14
|
+
|
15
|
+
* if require_pip is set to true
|
16
|
+
|
17
|
+
Install require packages and then installs ansible using the python pip command and ansible version must be specified. This allows a specific version of ansible to be installed.
|
18
|
+
|
19
|
+
* if require_pip3 is set to true
|
20
|
+
|
21
|
+
Install require packages and then installs ansible using the python pip3 command and ansible version must be specified. This allows a specific version of ansible to be installed.
|
22
|
+
|
23
|
+
Currently only works for Redhat/Centos.
|
24
|
+
|
25
|
+
* if require_ansible_repo is set to true (the default)
|
26
|
+
|
27
|
+
Installs from the operation system repository only with the ansible version that is in the particular repository and will use the ansible_version in the package name where appropriate.
|
28
|
+
|
29
|
+
NOTE: Set to ansible_package_name to 'ansible' when installing from the CentOS/Redhat extras repo, instead of the EPEL.
|
30
|
+
|
31
|
+
# Provisioner Options
|
32
|
+
|
33
|
+
kitchen-ansible runs the ansible playbook command http://linux.die.net/man/1/ansible-playbook with options from parameters in the kitchen.yml file:
|
34
|
+
|
35
|
+
key | default value | Notes
|
36
|
+
----|---------------|--------
|
37
|
+
additional_copy_path | | Arbitrary array of files and directories to copy into test environment e.g. vars or included playbooks. See below section Copying Additional Files
|
38
|
+
additional_copy_role_path | | Arbitrary array of files and directories to copy into test environment and are appended to the ANSIBLE_ROLES_PATH env var when running ansible. See below section Copying Additional Files
|
39
|
+
additional_ssh_private_keys | | List of additional ssh private key files to be added to ~/.ssh
|
40
|
+
ansible_apt_repo | ppa:ansible/ansible | `apt` repo; see `https://launchpad.net` `/~ansible/+archive/ubuntu/ansible` or `rquillo/ansible`
|
41
|
+
ansible_binary_path | NULL | If specified this will override the location where `kitchen` tries to run `ansible-playbook` from, i.e. `ansible_binary_path: /usr/local/bin`
|
42
|
+
ansible_check | false | Sets the `--check` flag when running Ansible
|
43
|
+
ansible_connection | local | use `ssh` if the host is not `localhost` (Linux) or `winrm` (Windows) or `none` if defined in inventory
|
44
|
+
ansible_cfg_path | ansible.cfg | location of custom ansible.cfg to get copied into test environment
|
45
|
+
ansible_cfg_overwrite | true | whether the ansible.cfg in the test environment should be overwritten or not.
|
46
|
+
ansible_diff | false | Sets the `--diff` flag when running Ansible
|
47
|
+
ansible_extra_flags | | Additional options to pass to ansible-playbook, e.g. `'--skip-tags=redis'`
|
48
|
+
ansible_host_key_checking | true | Strict host key checking in ssh
|
49
|
+
ansible_inventory | | Static or dynamic inventory file or directory or 'none' if defined in `ansible.cfg`
|
50
|
+
ansible_limit | | Further limits the selected host/group patterns
|
51
|
+
ansible_omnibus_remote_path | /opt/ansible | Server installation location of an Omnibus Ansible install
|
52
|
+
ansible_omnibus_url | `https://raw.githubusercontent.com` `/neillturner/omnibus-ansible` `/master/ansible_install.sh` | Omnibus Ansible install location
|
53
|
+
ansible_package_name | | Set to ansible when installing from the CentOS/Redhat extras repo, instead of the EPEL.
|
54
|
+
ansible_platform | Naively tries to determine | OS platform of server
|
55
|
+
ansible_playbook_command | | Override the Ansible playbook command
|
56
|
+
ansible_sles_repo | `http://download.opensuse.org/repositories` `/systemsmanagement/SLE_12` `/systemsmanagement.repo` | Zypper SuSE Ansible repo
|
57
|
+
ansible_source_url | `git://github.com/ansible/ansible.git` | Git URL of Ansible source
|
58
|
+
ansible_source_rev | | Branch or tag to install Ansible source
|
59
|
+
ansible_sudo | true | Determines whether `ansible-playbook` is executed as root or as the current authenticated user
|
60
|
+
ansible_vault_password_file | | Path to Ansible Vault password file. Can also be an array of files.
|
61
|
+
ansible_verbose | false | Extra information logging
|
62
|
+
ansible_verbosity | 1 | Sets the verbosity flag appropriately, e.g.: `1 => '-v', 2 => '-vv', 3 => '-vvv' ...`. Valid values are: `1, 2, 3, 4` or `:info, :warn, :debug, :trace`
|
63
|
+
ansible_version | latest | Desired version, only affects `apt-get` installs
|
64
|
+
ansible_yum_repo | nil | `yum` repo for EL platforms
|
65
|
+
ansiblefile_path | | Path to Ansiblefile
|
66
|
+
callback_plugins_path | callback_plugins | Ansible repo `callback_plugins` directory
|
67
|
+
chef_bootstrap_url | `https://www.chef.io/chef/install.sh` | The Chef install
|
68
|
+
custom_pre_install_command | nil | Custom shell command to be used at beginning of install stage. Can be multiline.
|
69
|
+
custom_pre_play_command | nil | Custom shell command to be used before the ansible play stage. Can be multiline. See examples below.
|
70
|
+
custom_post_install_command | nil | Custom shell command to be used at after the install stage. Can be multiline.
|
71
|
+
custom_post_play_command | nil | Custom shell command to be used after the ansible play stage. Can be multiline. See examples below.
|
72
|
+
enable_yum_epel | false | Enable the `yum` EPEL repo
|
73
|
+
env_vars | Hash.new | Hash to set environment variable to use with `ansible-playbook` command
|
74
|
+
extra_vars | Hash.new | Hash to set the `extra_vars` passed to `ansible-playbook` command
|
75
|
+
extra_vars_file | nil | file containing environment variables e.g. `private_vars/production.yml site.yml` Don't prefix with a @ sign.
|
76
|
+
filter_plugins_path | filter_plugins | Ansible repo `filter_plugins` directory
|
77
|
+
galaxy_ignore_certs | false | Ignore certificate errors when installing roles with ansible-galaxy.
|
78
|
+
group_vars_path | group_vars | Ansible repo group_vars directory
|
79
|
+
host_vars_path | host_vars | Ansible repo hosts directory
|
80
|
+
hosts | | Create Ansible hosts file for localhost with this server group or list of groups
|
81
|
+
http_proxy | nil | Use HTTP proxy when installing Ansible, packages and running Ansible
|
82
|
+
https_proxy | nil | Use HTTPS proxy when installing Ansible, packages and running Ansible
|
83
|
+
idempotency_test | false | Enable to test Ansible playbook idempotency
|
84
|
+
idempotency_tags | [] | Adds a `--tags` parameter with the specified tags to the second invocation of `ansible-playbook` when `idempotency_test` is set to `true`
|
85
|
+
idempotency_skip_tags | [] | Adds a `--skip-tags` parameter with the specified tags to the second invocation of `ansible-playbook` when `idempotency_test` is set to `true`
|
86
|
+
ignore_extensions_from_root | ['.pyc'] | allow extensions to be ignored when copying from roles using additional_copy_role_path or doing recursive_additional_copy_path
|
87
|
+
ignore_paths_from_root | [] | allow extra paths to be ignored when copying from roles using additional_copy_role_path or using recursive_additional_copy_path
|
88
|
+
kerberos_conf_file | | Path of krb5.conf file using in Windows support
|
89
|
+
keep_playbook_path | false | Keep directory structure of `playbook`, e.g. when including vars with relativ paths from playbook
|
90
|
+
library_plugins_path | library | Ansible repo library plugins directory
|
91
|
+
lookup_plugins_path | lookup_plugins | Ansible repo `lookup_plugins` directory
|
92
|
+
max_retries | 1 | maximum number of retry attempts of converge command
|
93
|
+
modules_path | | Ansible repo manifests directory
|
94
|
+
no_proxy | nil | List of URLs or IPs that should be excluded from proxying
|
95
|
+
playbook | default.yml | Playbook for `ansible-playbook` to run
|
96
|
+
private_key | | ssh private key file for ssh connection
|
97
|
+
python_sles_repo | `http://download.opensuse.org/repositories` `/devel:/languages:/python/SLE_12` `/devel:languages:python.repo` | Zypper SuSE python repo
|
98
|
+
recursive_additional_copy_path | | Arbitrary array of files and directories to copy into test environment. See below section Copying Additional Files
|
99
|
+
require_ansible_omnibus | false | Set to `true` if using Omnibus Ansible `pip` install
|
100
|
+
require_ansible_repo | true | Set if installing Ansible from a `yum` or `apt` repo
|
101
|
+
require_ansible_source | false | Install Ansible from source using method described [here](http://docs.ansible.com/intro_installation.html#running-from-source). Only works on Debian/Ubuntu at present
|
102
|
+
require_chef_for_busser | true | Install Chef to run Busser for tests. NOTE: kitchen 1.4 only requires Ruby to run Busser so this is not required.
|
103
|
+
require_pip | false | Set to `true` if Ansible is to be installed through `pip`).
|
104
|
+
require_pip3 | false | Set to `true` if Ansible is to be installed through `pip3`).
|
105
|
+
require_ruby_for_busser | false | Install Ruby to run Busser for tests
|
106
|
+
require_windows_support | false | Install [Windows support](http://docs.ansible.com/ansible/intro_windows.html)
|
107
|
+
requirements_path | | Path to Ansible Galaxy requirements
|
108
|
+
requirements_collection_path | | Path to Ansible Galaxy requirements
|
109
|
+
retry_on_exit_code | [] | Array of exit codes to retry converge command against
|
110
|
+
role_name | | use when the repo name does not match the name the role is published as.
|
111
|
+
roles_path | roles | Ansible repo roles directory
|
112
|
+
shell_command | 'sh' | Shell command to use, usually an alias for bash. may need to set to bash.
|
113
|
+
show_command_output | false | Show output of commands that are run to provision system.
|
114
|
+
ssh_known_hosts | | List of hosts that should be added to ~/.ssh/known_hosts
|
115
|
+
sudo_command | sudo -E | `sudo` command; change to `sudo -E -H` to be consistent with Ansible
|
116
|
+
update_package_repos | true | Update OS repository metadata
|
117
|
+
wait_for_retry | 30 | number of seconds to wait before retrying converge command
|
118
|
+
ignore_ansible_cfg | false | If true, values from ansible.cfg file will not be loaded.
|
119
|
+
|
120
|
+
## require_pip3
|
121
|
+
|
122
|
+
if using python 3 and wish to install via pip specify
|
123
|
+
```yaml
|
124
|
+
ansible_binary_path: /usr/local/bin
|
125
|
+
require_pip3: true
|
126
|
+
```
|
127
|
+
|
128
|
+
|
129
|
+
you must specify ansible_binary_path as well.
|
130
|
+
|
131
|
+
Currently this only works for Centos and Redhat
|
132
|
+
|
133
|
+
## Ansible Inventory
|
134
|
+
|
135
|
+
Ansible has the concept of an [inventory](http://docs.ansible.com/ansible/latest/intro_inventory.html).
|
136
|
+
|
137
|
+
Ansible then connects to these servers and processes the playbook against the server.
|
138
|
+
|
139
|
+
See also [Host inventories](https://ansible-tips-and-tricks.readthedocs.io/en/latest/ansible/inventory/).
|
140
|
+
|
141
|
+
|
142
|
+
### ansible Inventory parameter
|
143
|
+
|
144
|
+
if you have an ansible inventory file you can specify it in the ansible_inventory parameter in the .kitchen.yml file.
|
145
|
+
```yaml
|
146
|
+
ansible_inventory: myinventoryfile.txt
|
147
|
+
```
|
148
|
+
or if you have an ansible.cfg file specify
|
149
|
+
```yaml
|
150
|
+
ansible_inventory: none
|
151
|
+
```
|
152
|
+
it will look for the file in the root of your repository.
|
153
|
+
|
154
|
+
or it can be a directory from the root of your repository and contain scripts to implement [dynamic inventory](http://docs.ansible.com/ansible/latest/intro_dynamic_inventory.html)
|
155
|
+
|
156
|
+
### hosts parameter
|
157
|
+
|
158
|
+
if you don't specify an inventory file then you must specify the hosts parameter in the .kitchen.yml file.
|
159
|
+
|
160
|
+
kitchen ansible uses this information to create a hosts file that is used by ansible with the ansible command is run.
|
161
|
+
|
162
|
+
it can either be a name of a single server
|
163
|
+
|
164
|
+
```yaml
|
165
|
+
hosts: myhost
|
166
|
+
```
|
167
|
+
|
168
|
+
or any array of hosts:
|
169
|
+
|
170
|
+
```yaml
|
171
|
+
hosts:
|
172
|
+
- myhost1
|
173
|
+
- myhost2
|
174
|
+
```
|
175
|
+
|
176
|
+
the hosts file that is generated always contains in the first line
|
177
|
+
|
178
|
+
```yaml
|
179
|
+
localhost ansible_connection=local
|
180
|
+
```
|
181
|
+
so that it will process against the locahost.
|
182
|
+
|
183
|
+
and it will create a hosts file that includes the hosts you specify
|
184
|
+
|
185
|
+
```yaml
|
186
|
+
localhost ansible_connection=local
|
187
|
+
myhost1
|
188
|
+
myhost2
|
189
|
+
localhost
|
190
|
+
```
|
191
|
+
|
192
|
+
|
193
|
+
## Copying Additional Files
|
194
|
+
|
195
|
+
Several parameters have been developed rather organically to support the requirement to copy additional files beyond the ones in the standard ansible locations.
|
196
|
+
* These could be used for the verification phase later
|
197
|
+
* additional files required by the application
|
198
|
+
* or these could be ansible roles
|
199
|
+
|
200
|
+
### additional_copy_path - Arbitrary array of files and directories to copy into test environment
|
201
|
+
* If you specify a directory it will copy all the files to /tmp/kitchen with the directory structure
|
202
|
+
* if you specify the full file name they are copied to the top of the /tmp/kitchen folder in the server and the path is ignored.
|
203
|
+
i.e. if we have a directory data/ containing file xyz.txt
|
204
|
+
```
|
205
|
+
additional_copy_path:
|
206
|
+
- data/xyz.txt
|
207
|
+
```
|
208
|
+
it will copy data/xyz.txt to /tmp/kitchen/xyz.txt
|
209
|
+
* if you specify the directory without the filename it will preserve the path when copying to /tmp/kitchen.
|
210
|
+
```
|
211
|
+
additional_copy_path:
|
212
|
+
- data
|
213
|
+
```
|
214
|
+
it will copy data/xyz.txt to /tmp/kitchen/data/xyz.txt
|
215
|
+
NOTE: additional_copy_path does copy files that are links but if you specify the full file path only the file name is copied to /tmp/kitchen
|
216
|
+
|
217
|
+
### recursive_additional_copy_path
|
218
|
+
This copies the directories in a resursive fashion which can work better for some directory structures
|
219
|
+
* It does not support specifying files with paths. i.e. you can only specify files at the top level of the repository
|
220
|
+
```
|
221
|
+
recursive_additional_copy_path:
|
222
|
+
- xyz.txt
|
223
|
+
```
|
224
|
+
* It does support copying directories in a similar fashion to additional_copy_path but uses recursion to discover the files in the directory structure which can be
|
225
|
+
problematic with files with links.
|
226
|
+
```
|
227
|
+
recursive_additional_copy_path:
|
228
|
+
- data
|
229
|
+
```
|
230
|
+
### additional_copy_role_path
|
231
|
+
This is the same as additional_copy_path but adds the extra paths to the ANSIBLE_ROLES_PATH ansible command parameter.
|
232
|
+
|
233
|
+
### ignore_paths_from_root and ignore_extensions_from_root
|
234
|
+
During recursive_additional_copy_path or additional_copy_role_path there are 2 additional parameters.
|
235
|
+
(NOTE: These don't apply with additional_copy_path)
|
236
|
+
* ignore_paths_from_root defaults to empty array []. This causes these paths to be ignored.
|
237
|
+
* ignore_extensions_from_root defaults to an array containg ['.pyc']. This causes files with these extensions to be ignored.
|
238
|
+
as these are implemented with the 'Find.prune' command they can be problematic with file links.
|
239
|
+
|
240
|
+
|
241
|
+
## Configuring Provisioner Options
|
242
|
+
|
243
|
+
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:
|
244
|
+
|
245
|
+
```yaml
|
246
|
+
---
|
247
|
+
driver:
|
248
|
+
name: vagrant
|
249
|
+
|
250
|
+
provisioner:
|
251
|
+
name: ansible_playbook
|
252
|
+
roles_path: roles
|
253
|
+
hosts: tomcat-servers
|
254
|
+
require_ansible_repo: true
|
255
|
+
ansible_verbose: true
|
256
|
+
ansible_verbosity: 2
|
257
|
+
ansible_diff: true
|
258
|
+
|
259
|
+
platforms:
|
260
|
+
- name: nocm_ubuntu-12.04
|
261
|
+
driver_plugin: vagrant
|
262
|
+
driver_config:
|
263
|
+
box: nocm_ubuntu-12.04
|
264
|
+
box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
|
265
|
+
|
266
|
+
suites:
|
267
|
+
- name: default
|
268
|
+
```
|
269
|
+
|
270
|
+
### Per-suite Structure
|
271
|
+
|
272
|
+
It can be beneficial to keep different Ansible layouts for different suites. Rather than having to specify the roles, modules, etc for each suite, you can create the following directory structure and they will automatically be found:
|
273
|
+
|
274
|
+
```
|
275
|
+
$kitchen_root/ansible/$suite_name/roles
|
276
|
+
$kitchen_root/ansible/$suite_name/modules
|
277
|
+
$kitchen_root/ansible/$suite_name/Ansiblefile
|
278
|
+
```
|
279
|
+
|
280
|
+
Multiple Line Structure
|
281
|
+
```yaml
|
282
|
+
provisioner::
|
283
|
+
command: |
|
284
|
+
sudo -s <<SERVERSPEC
|
285
|
+
cd /opt/gdc/serverspec-core
|
286
|
+
export SERVERSPEC_ENV=$EC2DATA_ENVIRONMENT
|
287
|
+
export SERVERSPEC_BACKEND=exec
|
288
|
+
serverspec junit=true tag=~skip_in_kitchen check:role:$EC2DATA_TYPE
|
289
|
+
SERVERSPEC
|
290
|
+
```
|