2017-07-12 10 views
0

Ich bin neu in Vagabund und ich versuche, eine Vagabund-Box mit dem Namen 'Haproxy' und die Verwendung von Ansible, um Zeug zu starten. meine vagrant Datei ist wie folgt:Provisioner konnte nicht gefunden werden

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 

Aber das sagt:

[email protected]:~/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. 

Antwort

3

zuerst Sie nicht provisioner |haproxy| nennen kann, provisioner sind strictly defined, müssen Sie eine provisioner aus den bekannten erklären. Hier ist Ihr Provisioner ansässig durch die dann Variable ansible.verbose.

Wenn es die Absicht war es, die provisioner Arbeit mit einem vm mit dem Namen ‚haproxy‘, damit Sie Ihren Vagrantfile wie folgt definieren:

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 

Aber man kann es so auch tun:

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 
+0

oh okay .. ja .. nur noch eine Hilfe .. wenn ich der Instanz einen Hostnamen geben und auch einen Port weiterleiten möchte, was sollte der syntex sein –

+0

Sie sollten beide [Maschineneinstellungen] (https://www.vagrantup.com/docs/vagrantfile/machine_settings.html) und der [weitergeleitete Port] (https: //www.v agrantup.com/docs/networking/forwarded_ports.html) Dokumentationen. –

Verwandte Themen