我正在尝试使用 Vagrant + Ansible 提供一些开发环境。我使用 OSX 作为主机,使用 CentOS 5.6 作为来宾。
这是我的流浪文件
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "centos56"
config.vm.box_url = "http://dl.dropbox.com/u/9227672/centos-5.6-x86_64-netinstall-4.1.6.box"
config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
ansible.verbose = true
end
end
这是我的剧本:
---
- hosts: all
tasks:
- name: PING
command: ping 127.0.0.1
这是错误:
~/dev/vms/wlsCluster/master2> vagrant provision
[default] Running provisioner: ansible...
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
fatal: [default] => {'msg': "FAILED: (25, 'Inappropriate ioctl for device')", 'failed': True}
TASK: [PING] ******************************************************************
FATAL: no hosts matched or all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/Users/brunajardim/playbook.retry
default : ok=0 changed=0 unreachable=1 failed=0
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
我读过它可能与私钥有关。而且我可以使用像*--private-key=$HOME/.vagrant.d/insecure_private_key*这样的参数来解决问题。现在,如何将vagrant provision命令与 ansible 一起使用并将此参数传递给它?