Runs the sample provided by ANSIBLE LOCAL PROVISIONER failed?

124 views
Skip to first unread message

Guofeng Zhang

unread,
Jul 25, 2016, 2:43:54 AM7/25/16
to Vagrant
Hi,

I follow "Ansible Parallel Execution from a Guest", created "Vagrantfile"file, "inventory" file, "ansible.cfg" file, and placed them on the same directory (The Vagrant project directory).

But after runs "vagrant up", I go the following output:

cd /vagrant && PYTHONUNBUFFERED=1 ANSIBLE_NOCOLOR=true ansible-playbook --limit="all" --inventory-file=inventory --sudo -v playbook.yml
Using /vagrant/ansible.cfg as config file

PLAY [print out operating system] **********************************************

TASK [setup] *******************************************************************
fatal: [node2]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh.", "unreachable": true}
fatal: [node1]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh.", "unreachable": true}
ok: [controller]

TASK [debug] *******************************************************************
ok: [controller] => {
    "ansible_distribution": "Ubuntu"
}
        to retry, use: --limit @playbook.retry

PLAY RECAP *********************************************************************
controller                 : ok=2    changed=0    unreachable=0    failed=0
node1                      : ok=0    changed=0    unreachable=1    failed=0
node2                      : 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.

I cannot figure out why node1 and node2 are unreachable. Your advices are appreciated.

This is the playbook file:
- name: print out operating system
  hosts: all
  gather_facts: True
  tasks:
  - debug: var=ansible_distribution




  

Guofeng Zhang

unread,
Jul 25, 2016, 2:56:20 AM7/25/16
to Vagrant
I use Vagrant 1.8.5

在 2016年7月25日星期一 UTC+8下午2:43:54,Guofeng Zhang写道:

Alvaro Miranda Aguilera

unread,
Jul 25, 2016, 4:48:43 AM7/25/16
to vagra...@googlegroups.com
seems is running in controller

do you configure a private_network and provision /etc/hosts ? so all the nodes know each other?



--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/79becbbe-bff8-4312-be81-ec13a8689e2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Guofeng Zhang

unread,
Jul 25, 2016, 12:27:23 PM7/25/16
to vagra...@googlegroups.com
I just copy and paste the code from the doc "ANSIBLE LOCAL PROVISIONER" to related files.

I configured private network, but not setup /etc/hosts.

By removing "config.vm.box = ..." and add "machine.vm.box = ..." to each VM definition. It works now as expected. But I do not understand why making such change make it work,


Thanks for your response.


You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/2-yOGvdlAgI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ex5P3BXPUqbARLBqVRjks_LQinYB9%3DQwnfvPtCsSPo7tg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages