I believe this email ended up being delayed a bit.  Jimmy and I worked through 
this yesterday and changed the wait_for task to look like:

- local_action: wait_for port=22 delay=20 hostname="{{ ansible_ssh_host }}"


-- 
Matt Martz
[email protected]

On March 21, 2014 at 12:10:24 AM, Jimmy Prescott ([email protected]) wrote:

Hello,

Searched around before posting this but I was unable to find anything useful.

Anyway I am using the rax module to provision a server in the Rackspace Cloud 
using pyrax etc. The problem is that SOMETIMES the play will fail with a 
connection refused error.:

PLAY [Wait for port 22 to be ready] *******************************************

TASK: [wait_for port=22 delay=20] *********************************************
fatal: [testing6] => {'msg': 'FAILED: [Errno 111] Connection refused', 
'failed': True}

FATAL: all hosts have already failed -- aborting

I tried adding the wait_for with a delay of 20 but maybe I am doing it wrong. 
Here is what my play looks like up to the point of failure:

---
- name: testing rackspace cloud
  hosts: localhost
  tasks:
    - name: Provision the cloud server
      local_action:
        module: rax
        name: "testing"
        flavor: "performance1-1"
        image: "centos-65"
        count: "1"
        group: "web"
        wait: yes
      register: rax

    - name: Add servers to 'raxhosts' group
      local_action:
        module: add_host
        hostname: "{{ item.name }}"
        ansible_ssh_host: "{{ item.rax_accessipv4 }}"
        ansible_ssh_pass: "{{ item.rax_adminpass }}"
        ansible_ssh_user: root
        groupname: raxhosts
      with_items: rax.success
      when: rax.action == 'create'

- name: Wait for port 22 to be ready
  hosts: raxhosts
  gather_facts: False
  tasks:
    - wait_for: port=22 delay=20

Any help on this is appreciated. The issue is intermittent sometimes it will 
run 10 times in a row then fail a few time then work again.

Thanks!
--
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/77da0480-8577-4699-961b-a37863ecfb79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/etPan.532c2c07.6b8b4567.11a12%40mobiletuvix.rackspace.corp.
For more options, visit https://groups.google.com/d/optout.

Reply via email to