# GCE Deploy new host

**URL:** <https://forum.ansible.com/t/gce-deploy-new-host/15595>\
**Category:** Ansible Project\
**Created:** [July 2, 2014, 7:47pm UTC](https://forum.ansible.com/t/gce-deploy-new-host/15595 "2014-07-02T19:47:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Olliver](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Mark\_Olliver](https://forum.ansible.com/u/Mark_Olliver)\
**Post date:** [July 2, 2014, 7:47pm UTC](https://forum.ansible.com/t/gce-deploy-new-host/15595/1 "2014-07-02T19:47:38Z")

</div>

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=XXX@developer.gserviceaccount.com](mailto:service_account_email=XXX@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

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 2, 2014, 10:21pm UTC](https://forum.ansible.com/t/gce-deploy-new-host/15595/2 "2014-07-02T22:21:24Z")

</div>

That’s a pretty terrible error message IMHO, can you file a bug on this ([github.com/ansible/ansible](http://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)

```auto

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

```

```auto

```

```auto

```

---

<div class="post-metadata">

**Author:** ![Eric\_Johnson](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@Eric\_Johnson](https://forum.ansible.com/u/Eric_Johnson)\
**Post date:** [July 7, 2014, 12:27am UTC](https://forum.ansible.com/t/gce-deploy-new-host/15595/3 "2014-07-07T00:27:27Z")

</div>

Feel free to flag me, @erjohnso to the issue so I can fix up the error messages on my next pass through the modules.

---

<div class="post-metadata">

**Author:** ![James\_Laska](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@James\_Laska](https://forum.ansible.com/u/James_Laska)\
**Post date:** [July 23, 2014, 8:14pm UTC](https://forum.ansible.com/t/gce-deploy-new-host/15595/4 "2014-07-23T20:14:32Z")

</div>

I’ve filed an issue in github to track this issue.

[https://github.com/ansible/ansible/issues/8265](https://github.com/ansible/ansible/issues/8265)

Thanks,  
James
