मैं कुछ Vagrant/Ansible सामान करने की कोशिश कर रहा हूं, लेकिन शुरुआत से समस्याओं में भाग रहा हूं। यहाँ मेरी Vagrantfile है:वग्रेंट उत्तरदायी प्रावधान एसएसएच त्रुटि
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.6.66"
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
end
config.vm.provision "ansible" do |ansible|
ansible.playbook = "site.yml"
end
end
site.yml बस
---
- name: Bring up server with MySQL, Nginx, and PHP-FPM
hosts: all
remote_user: root
roles:
- common
और आम/कार्य/main.yml है
---
- name: Update apt
apt: update_cache=yes
जब vagrant up
कर रही है, उत्पादन
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Setting the name of the VM: ansible-provision_default_1412793587231_72507
==> default: Clearing any previously set forwarded ports...
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 => 2200 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Checking for host entries
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => /Users/bram/Projects/Brammm/ansible-provision
==> default: Running provisioner: ansible...
PLAY [Bring up server with MySQL, Nginx, and PHP-FPM] *************************
GATHERING FACTS ***************************************************************
fatal: [default] => SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue
TASK: [common | Update apt] ***************************************************
FATAL: no hosts matched or all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/Users/bram/site.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.
है
यदि मैं देखता हूं
default ansible_ssh_host=127.0.0.1 ansible_ssh_port=2200
मैं के रूप में private_network में सेट वहाँ आईपी समान होने की अपेक्षा होगी: .vagrant/provisioners/ansible/सूची/vagrant_ansible_inventory में, मैं निम्नलिखित देखते हैं? मैं इस पर एक घंटे से अधिक समय से घूर रहा हूं, क्या मैंने कुछ गलत किया? मुझे लगता है कि आईपी ठीक से या कुछ सेट नहीं किया जा रहा है। मैं ping 192.168.6.66
कर सकता हूं।
'हम आपको सलाह देते हैं कि आप -vvvv का उपयोग करके कमांड चलाएं, जो एसएसएच डीबगिंग आउटपुट को समस्या का निदान करने में मदद करने के लिए सक्षम करेगा' क्या आपने ऐसा किया था? – brunsgaard