2
我正在使用廚房來測試我的食譜,並且我在Vagrantfile中做了一個網絡配置,但廚房實例沒有看到這個配置。廚房無法看到網絡配置成流浪文件
這是我的流浪文件配置。
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.hostname = "demo-berkshelf"
config.vm.box = "ubuntu-12.04"
config.vm.network :private_network, ip: "33.33.33.10"
config.berkshelf.enabled = true
config.vm.provision :chef_solo do |chef|
chef.json = {
:mysql => {
:server_root_password => 'rootpass',
:server_debian_password => 'debpass',
:server_repl_password => 'replpass'
}
}
chef.run_list = [
"recipe[demo::default]"
]
end
end
而且這是我.kitchen.yml配置。
---
driver:
name: vagrant
provisioner:
name: chef_solo
platforms:
- name: ubuntu-12.04
driver_config:
box: "ubuntu-12.04"
suites:
- name: default
run_list:
- recipe[demo::default]
attributes:
當我登錄到廚房給我看一個網絡配置我不希望
[email protected]:~$ kitchen login default-ubuntu-1204
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)
* Documentation: https://help.ubuntu.com/
Welcome to your Vagrant-built virtual machine.
Last login: Wed Jan 22 14:02:59 2014 from 10.0.2.2
[email protected]:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:12:96:98
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe12:9698/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:360 errors:0 dropped:0 overruns:0 frame:0
TX packets:365 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:49328 (49.3 KB) TX bytes:42004 (42.0 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
哪裏是我在Vagrantfile配置33.33.33.10? 預先感謝您的幫助。
備案33.33.33.x是美國國防部保留的。由於大多數平民不會連接到這個網絡,因此在本地使用通常是安全的,因爲您不會發生路由衝突(儘管我不建議親自使用它)。我通常在範例中看到這個範圍,而不是在該領域中使用。 –