无法找到供应者

时间:2017-07-12 15:39:09

标签: vagrant vagrantfile

我是流浪汉的新手,我正在尝试推出一个名为'haproxy'并使用ansible来部署东西的流浪盒。我的流浪文件如下:

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"
  config.ssh.insert_key = false
  config.vm.define "haproxy" do |haproxy|
    config.vm.provision "haproxy" do |haproxy|
      ansible.verbose = "v"
      ansible.playbook = "Ansible_BASES/haproxy.yml"
  end
  end
end

但是这说:

viper@nishstorm:~/Vagrant_TEST$ vagrant up 
Bringing machine 'haproxy' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* The 'haproxy' provisioner could not be found.

2 个答案:

答案 0 :(得分:3)

首先您无法调用供应商|haproxy|,供应商为strictly defined,您必须从已知供应商处申报供应商。在这里,您的配置文件是由当时变量ansible.verbose隐含的。{/ p>

如果目的是让配置程序使用名为“haproxy”的vm,则可以将Vagrantfile定义如下:

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.name = "haproxy"
  config.ssh.insert_key = false
  config.vm.provision "ansible" do |ansible|
    ansible.verbose = "v"
    ansible.playbook = "Ansible_BASES/haproxy.yml"
  end
end

但你也可以这样做:

Vagrant.configure("2") do |config|
  config.vm.define 'haproxy' do |haproxy|
    haproxy.vm.box = "ubuntu/trusty64"
    haproxy.ssh.insert_key = false
    haproxy.vm.provision "ansible" do |ansible|
      ansible.verbose = "v"
      ansible.playbook = "Ansible_BASES/haproxy.yml"
    end
  end
end

答案 1 :(得分:0)

安装配置插件可能会有所帮助

vagrant plugin install vagrant provision