|
8 | 8 | url: "fixing-converge" |
9 | 9 | --- |
10 | 10 |
|
11 | | -There are a few basic ways of dynamically configuring test-kitchen: |
| 11 | +There are a few basic ways of dynamically configuring Test Kitchen: |
12 | 12 |
|
13 | | -The YAML file can contain `<% erb %>`, which you could use for selecting drivers, etc. based on which platform your currently running, or based of environment variables. |
| 13 | +* A local configuration will be looked for in `.kitchen.local.yml` which could be used for development purposes. This is a file that is not typically checked into version control. |
| 14 | +* A global configuration file will also be looked for in `$HOME/.kitchen/config.yml` to set preferred defaults for all your projects. |
| 15 | +* Finally, each YAML file can contain ERB fragments, which you could use for selecting drivers, etc. based on which platform your currently running, or based of environment variables. |
14 | 16 |
|
15 | | -Test-kitchen well also look for a `.kitchen.local.yml` which could be used for development purposes. This is a file that's not typically checked into version control. |
16 | | - |
17 | | -Test Kitchen allows a "global" configuration file that you can drop off to set preferred defaults in ~/.kitchen/config.yml. That, along with allowing ERB, should provide plenty of customizability. |
18 | | - |
19 | | - |
20 | | -We're going to add some erb to our config by opening `.kitchen.yml` in your editor of choice so that it looks similar to: |
| 17 | +For example, you could modify `.kitchen.yml` (or `.kitchen.local.yml`, or `$HOME/.kitchen/config.yml`) to look like: |
21 | 18 |
|
22 | 19 | ~~~yaml |
23 | 20 | --- |
24 | | -<% if ENV['KITCHEN_ENV'] == 'development' %> |
25 | | -driver: |
26 | | - name: vagrant |
27 | | - |
28 | | -provisioner: |
29 | | - name: chef_solo |
30 | | -<% elsif ENV['KITCHEN_ENV'] == 'test' %> |
31 | 21 | driver: |
32 | 22 | name: openstack |
33 | 23 | openstack_username: <%= ENV['YOUR_OPENSTACK_USERNAME'] %> |
34 | 24 | openstack_api_key: <%= ENV['YOUR_OPENSTACK_API_KEY'] %> |
35 | 25 | openstack_auth_url: <%= ENV['YOUR_OPENSTACK_AUTH_URL'] %> |
36 | 26 | image_ref: <%= ENV['SERVER_IMAGE_ID'] %> |
37 | 27 | flavor_ref: <%= ENV['SERVER_FLAVOR_ID'] %> |
38 | | -provisioner: |
39 | | - name: chef_zero |
40 | | -<% end %> |
41 | | - |
42 | | -platforms: |
43 | | - - name: ubuntu-12.04 |
44 | | - - name: ubuntu-10.04 |
45 | | - - name: centos-6.4 |
46 | | - |
47 | | -suites: |
48 | | - - name: default |
49 | | - run_list: |
50 | | - - recipe[git::default] |
51 | | - attributes: |
52 | | - - name: server |
53 | | - run_list: |
54 | | - - recipe[git::server] |
55 | | - attributes: |
56 | 28 | ~~~ |
| 29 | + |
| 30 | +Keep in mind, this assumes you have an OpenStack deployment setup and ready to use. If this doesn't apply, let us continue. |
0 commit comments