nansencenter / nersc-vagrant

Nansen-Cloud provisioning with vagrant
GNU General Public License v3.0
0 stars 0 forks source link

Multi machine configuration doesn't work on Ubuntu of Anton #2

Closed akorosov closed 8 years ago

akorosov commented 8 years ago

vagrant up starts virtual machine for the course but it fails to provision. Apparently ansible tries to connect to 192.168.33.11:22 which is not accessible. Instead 127.0.0.1:2222 is accessible and should be used. I don't know if it is Ubuntu issue or my local network configuration issue. Here is the error :

PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --private-key=/home/antonk/py/nansat-lectures/nersc-vagrant/.vagrant/machines/course/virtualbox/private_key --user=vagrant --connection=ssh --limit='course' --inventory-file=provisioning/hosts -v provisioning/provision.yml

PLAY [192.168.33.11] ********************************************************** 

GATHERING FACTS *************************************************************** 
fatal: [192.168.33.11] => SSH Error: ssh: connect to host 192.168.33.11 port 22: Connection timed out
    while connecting to 192.168.33.11:22
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.

TASK: [common | Install required system packages.] **************************** 
FATAL: no hosts matched or all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/home/antonk/provision.retry

192.168.33.11              : 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.
akorosov commented 8 years ago

Aha! It crashes only after 784a2cc3a781557d4b84de5bb364978f84940ac1 !

akorosov commented 8 years ago

If I comment out [ssh_connection] +control_path = /tmp then it works...

tio00 commented 8 years ago

Hmm,

That means that we probably need to have a separate windows config, since that particular statement is windows-related…

--tor

  1. sep. 2015 kl. 21:17 skrev Anton Korosov notifications@github.com:

If I comment out [ssh_connection] +control_path = /tmp then it works...

— Reply to this email directly or view it on GitHub.

akorosov commented 8 years ago

Auch! I just ran into the same issue again. Even after I commented out [ssh_connection] +control_path = /tmp. It seems the first time vagrant up fails. And the second time 'vagrant provision' succeeds...

akorosov commented 8 years ago

Yes, I can confirm my observation. The first time I do vagrant up it does fail with exactly same error as before. The second time I run vagrant provision it continues without a problem.

akorosov commented 8 years ago

OK, I got it... Apparently it takes some time for my machine to create the virtual host and 'register' in the network. And ansible starts to provision right away, even before host is available. It is simply too fast :) I added timeout=30 to the ansible.cfg to slow it down a little and not it starts provisioning every time after vagrant up. Nevertheless these options still don't work: [ssh_connection] +control_path = /tmp

I had to commit them away.