Information Technology Reference
In-Depth Information
driver
:
network
:
- [
"private_network"
, {
ip
:
"192.168.33.7"
}
]
The static IP address should be chosen from the TCP/IP
reserved private address space
that
does not conflict with other machines on the same network. The IP address
192.168.33.7
should work for nearly everyone, as most routers don't use this subnet by default, so modify
your
.kitchen.yml
file accordingly, as shown in
Example 7-15
.
Example 7-15. chefdk/apache/.kitchen.yml
---
driver
:
name
:
vagrant
provisioner
:
name
:
chef_zero
platforms
:
-
name
:
centos65
driver
:
box
:
learningchef
/
centos65
box_url
:
learningchef
/
centos65
network
:
- [
"private_network"
, {
ip
:
"192.168.33.7"
}
]
suites
:
-
name
:
default
run_list
:
-
recipe
[
apache
:
:default
]
attributes
:
Unfortunately, Test Kitchen will apply network configuration settings in the
.kitchen.yml
only when running
kitchen create
the first time, when the sandbox environment is cre-
ated. Because we have already created the sandbox environment, we'll need to run
kitchen
destroy
first, before running
kitchen converge
, so it will create a new sandbox environ-
ment. Otherwise, Test Kitchen will ignore the networking change we just added to the
kit-
chen.yml
:
$
kitchen destroy default-centos65
$
kitchen converge default-centos65