# get IP of instance to pass it as command arguement

**URL:** <https://forum.ansible.com/t/get-ip-of-instance-to-pass-it-as-command-arguement/18057>\
**Category:** Ansible Project\
**Created:** [April 22, 2015, 9:14pm UTC](https://forum.ansible.com/t/get-ip-of-instance-to-pass-it-as-command-arguement/18057 "2015-04-22T21:14:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Test](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@John\_Test](https://forum.ansible.com/u/John_Test)\
**Post date:** [April 22, 2015, 9:14pm UTC](https://forum.ansible.com/t/get-ip-of-instance-to-pass-it-as-command-arguement/18057/1 "2015-04-22T21:14:25Z")

</div>

Hello

I want to pass some arguments within a playbook but unsure on how to do it

Playbook here:  
[http://pastebin.com/Ga1L1hCa](http://pastebin.com/Ga1L1hCa)

The first part creates an Openstack instance, then it attaches a floating IP.  
I want to grab the hostname and floating IP and use it in the 3rd task which is to create a DNS A record.

Appreciate the help!

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [April 22, 2015, 9:25pm UTC](https://forum.ansible.com/t/get-ip-of-instance-to-pass-it-as-command-arguement/18057/2 "2015-04-22T21:25:34Z")

</div>

you want to register the results of the first task

register: new\_instance

then you can access the information returned in that variable, use  
debug: var=new\_instance to examine the structure.
