Hi Abdul, It's not currently supported but certainly something we could add. Mind raising an issue at ansible/ansible-modules-core <https://github.com/ansible/ansible-modules-core/issues> so we can prioritize and get it added?
As for today, my feeling is that you could either gcloud command line tool, the uri <http://docs.ansible.com/ansible/uri_module.html> module with the GCE API <https://cloud.google.com/compute/docs/reference/latest/instances>, or perhaps use new subnetwork <https://github.com/ansible/ansible-modules-core/pull/3701> support with a small subnetwork (This won't give you control over the IP, but does keep it in Ansible; minimum subnetwork size is /29). Thanks, Tom On Sunday, June 12, 2016 at 7:46:22 PM UTC-7, Abdul Jabbar Azam wrote: > > Hello, > > I'd like to add a private IP address when creating google gce instances. > Looking at the docs this doesn't seem to be possible. > http://docs.ansible.com/ansible/gce_module.html. I am using version 2.1 > from the source at github cloned using git a few weeks ago. > > If I use the gloud SDK I can create the instance > > gcloud compute --project "my-project" instances create "bootstrap" --zone > "europe-west1-d" --machine-type "f1-micro" --subnet > "default-6f68d4d6fabcb680" --private-network-ip "10.132.0.2" --metadata > "block-project-ssh-keys=true" --maintenance-policy "MIGRATE" --scopes > default="https://www.googleapis.com/auth/cloud-platform" --disk > "name=docker-disk-for-instance-bootstrap,device-name=docker-disk-for-bootstrap,mode=rw,boot=no" > > --image "/centos-cloud/centos-7-v20160511" --boot-disk-size "10" > --boot-disk-type "pd-standard" --boot-disk-device-name "bootstrap" > > I need to create a few instances with static IP addresses because I'm > trying to write an install script for DCOS on GCE and a number of the > instances need a private static IP address. > > Is there a way to add a private IP addresses to a google instance using > the gce module or should I call the gcloud tool using the command module? > -- 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/9256e6d9-2ca2-411c-8efa-53f97006911a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
