I am trying to use a Compute Engine instance to manage all my nodes within 
the project.

so far I am able to create instances without issues, but somehow I am not 
able to go further and use ansible to manage those nodes. it seems to have 
problem to ssh to the newly created instances,  I went through all 
information I google'd, but did not help. I am using a service account just 
like what ansible document says.

below is one of the sample I used, it actually created a "dev" instance 
successfully but failed to wait for ssh to the public_ip of the new node. 
do I have to enable firewall rule or something like that ?

- name: Create instance(s)
  hosts: localhost
  gather_facts: no
  connection: local

  vars:
    machine_type: f1-micro # default
    image: debian-8
    service_account_email: [email protected]
    credentials_file: xxxxx
    project_id: xxxxx

  tasks:
    - name: Launch instances
      gce:
          instance_names: dev
          machine_type: "{{ machine_type }}"
          image: "{{ image }}"
          service_account_email: "{{ service_account_email }}"
          credentials_file: "{{ credentials_file }}"
          project_id: "{{ project_id }}"
          tags: webserver
      register: gce

    - name: Wait for SSH to come up
      wait_for: host={{ item.public_ip }} port=22 delay=10 timeout=60
      with_items: "{{ gce.instance_data }}"




any idea ?

-- 
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/7c98d786-b889-4dfc-8cda-e5276fa7c666%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to