Repository: ansible/ansible-modules-core

Issue:
an instance without an external ip address
##### ISSUE TYPE

Feature Idea
##### COMPONENT NAME

gce module
##### ANSIBLE VERSION

N/A
##### SUMMARY

Google cloud allows to run its instances without an external ip address. It's very useful in some cases. I saw in http://docs.ansible.com/ansible/gce_module.html that the "external_ip" parameter does not have an option to disable "attach an external_ip while a new instance is creating". Can you add this feature or is the a way around it now?



Discussion:
[module: cloud/google/gce.py]

@kernelt -- Thanks for submitting this feature idea.

@erjohnso -- Pinging you to bring this feature request to your attention. Please note that you are under no particular obligation to add this feature. (Also: This may be a question simply to be answered -- not sure! :D)

We encourage all Ansible community members to submit pull requests to satisfy feature requests. Consult the module guidelines (http://docs.ansible.com/ansible/developing_modules.html) for more information.

Definitely a feature to add to ansible. I believe libcloud (underlying client library) does support it though.

@erjohnso, ping. This issue is still waiting on your response.
[click here for bot help](https://github.com/jctanner/ansibullbot/blob/ISSUE_TRIAGE_CLASS/ISSUE_HELP.md)

<!--- boilerplate: issue_renotify_maintainer --->

/cc @supertom

You are able to specify 'none' for the external_ip field as of [this commit](https://github.com/ansible/ansible-modules-core/commit/94c1b55744eed7b2cf28cb08326f37f6d7f4c0a6).  This functionality is available in the devel branch.  I've confirmed it by running this command:

ansible localhost -m gce -a "instance_names=gce-test-foo2 external_ip=none state=present"

```
localhost | SUCCESS => {
    "changed": true, 
    "instance_data": [
        {
            "disks": [
                "gce-test-foo2"
            ], 
            "image": "debian-7-wheezy-v20160531", 
            "machine_type": "n1-standard-1", 
            "metadata": {}, 
            "name": "gce-test-foo2", 
            "network": "default", 
            "private_ip": "10.128.0.10", 
            "public_ip": null, 
            "status": "RUNNING", 
            "subnetwork": "default-1f05f3ba030dc6b6", 
            "tags": [], 
            "zone": "us-central1-a"
        }
    ], 
    "instance_names": [
        "gce-test-foo2"
    ], 
    "state": "present", 
    "zone": "us-central1-a"
}
```

/cc @ryansb 

@supertom, ping. This issue is still waiting on your response.
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)

<!--- boilerplate: issue_renotify_maintainer --->


Resolving patch:
diff --git a/cloud/google/gce.py b/cloud/google/gce.py
--- a/cloud/google/gce.py
+++ b/cloud/google/gce.py
@@ -142,7 +142,7 @@
   external_ip:
     version_added: "1.9"
     description:
-      - type of external ip, ephemeral by default; alternatively, a list of fixed gce ips or ip names can be given (if there is not enough specified ip, 'ephemeral' will be used)
+      - type of external ip, ephemeral by default; alternatively, a list of fixed gce ips or ip names can be given (if there is not enough specified ip, 'ephemeral' will be used). Specify 'none' if no external ip is desired.
     required: false
     default: "ephemeral"
   disk_auto_delete:


Test patch: