# Attach static ip address to gce instance on launch

**URL:** <https://forum.ansible.com/t/attach-static-ip-address-to-gce-instance-on-launch/17145>\
**Category:** Ansible Project\
**Created:** [December 25, 2014, 7:50pm UTC](https://forum.ansible.com/t/attach-static-ip-address-to-gce-instance-on-launch/17145 "2014-12-25T19:50:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harsh001](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@harsh001](https://forum.ansible.com/u/harsh001)\
**Post date:** [December 25, 2014, 7:50pm UTC](https://forum.ansible.com/t/attach-static-ip-address-to-gce-instance-on-launch/17145/1 "2014-12-25T19:50:32Z")

</div>

Hi , Im trying to come up with a play that will attach a previously reserved static ip address to a instance on creation by ansible.from [https://cloud.google.com/compute/docs/instances-and-network#staticnetworkaddress](https://cloud.google.com/compute/docs/instances-and-network#staticnetworkaddress) recommended course seem to use $ gcloud compute instances create example-instance --address example-address-2 to achieve this.Is there an equivalent within the ansible gce module.Would like to use it to setup a nginx server so that the IP persists even if the instance needs to be replaced for whatever reason.  
Attaching at creation seems to be the better option as attaching it later increases the complexity of the task.

---

<div class="post-metadata">

**Author:** ![harsh001](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@harsh001](https://forum.ansible.com/u/harsh001)\
**Post date:** [December 29, 2014, 11:07am UTC](https://forum.ansible.com/t/attach-static-ip-address-to-gce-instance-on-launch/17145/2 "2014-12-29T11:07:26Z")

</div>

Well decided to go with Hashicorp’s terraform tool for the IP address ,instance creation and attachment and will be trying to use its local\_exec feature to call my playbooks.

---

<div class="post-metadata">

**Author:** ![Peter\_Mooshammer](https://avatars.discourse-cdn.com/v4/letter/p/c5a1d2/32.png) [@Peter\_Mooshammer](https://forum.ansible.com/u/Peter_Mooshammer)\
**Post date:** [January 14, 2015, 6:50pm UTC](https://forum.ansible.com/t/attach-static-ip-address-to-gce-instance-on-launch/17145/3 "2015-01-14T18:50:09Z")

</div>

Feature request!!! +1
