GCE Deploy new host

116 views
Skip to first unread message

Mark Olliver

unread,
Jul 2, 2014, 3:47:38 PM7/2/14
to ansible...@googlegroups.com
Hi,

I am trying to create a new host using the GCE module but I keep hitting the same user. The credentials I am using do have full access.

## Playbook
- name: Create instances
  hosts: localhost
  tasks:
  - name: Launch instances
    local_action: gce instance_names=dcom
                  machine_type=n1-highcpu-2
                  image=backports-debian-7-wheezy
                  zone=europe-west1-b
                  metadata='{"dc":"gce"}'
                  project_id=111111111
                  pem_file=/opt/ansible/.keys/pkey.pem
                  service_account_email=X...@developer.gserviceaccount.com
    register: gce


## Command run:
ansible-playbook -s -i plugins/inventory/gce.py manifest/master.yml


## Error
PLAY [Create instances] *******************************************************

GATHERING FACTS ***************************************************************
ok: [localhost]

TASK: [Launch instances] ******************************************************
failed: [localhost] => {"changed": false, "failed": true}
msg: Missing required create instance variable

FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************

localhost                  : ok=1    changed=0    unreachable=0    failed=1


Any ideas or help would be appreciated.

Thanks

Mark

Michael DeHaan

unread,
Jul 2, 2014, 6:21:27 PM7/2/14
to ansible...@googlegroups.com
That's a pretty terrible error message IMHO, can you file a bug on this (github.com/ansible/ansible) so we can report the actual parameter that is missing.

From reading the code:

    # These variables all have default values but check just in case
    if not lc_image or not lc_network or not lc_machine_type or not lc_zone:
        module.fail_json(msg='Missing required create instance variable',
                changed=False)

Appears to be one of those 4. We should totally say which one errored it out though.






--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/287705e2-9d1a-4005-88ee-f280c983ef5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eric Johnson

unread,
Jul 6, 2014, 8:27:27 PM7/6/14
to ansible...@googlegroups.com
Feel free to flag me, @erjohnso to the issue so I can fix up the error messages on my next pass through the modules.

James Laska

unread,
Jul 23, 2014, 4:14:32 PM7/23/14
to ansible...@googlegroups.com
I've filed an issue in github to track this issue.

https://github.com/ansible/ansible/issues/8265

Thanks,
James
Reply all
Reply to author
Forward
0 new messages