# How to pass variable to another playbook and from imported playbook to role used by it

**URL:** <https://forum.ansible.com/t/how-to-pass-variable-to-another-playbook-and-from-imported-playbook-to-role-used-by-it/35425>\
**Category:** Ansible Project\
**Tags:** azure\
**Created:** [June 28, 2021, 2:41pm UTC](https://forum.ansible.com/t/how-to-pass-variable-to-another-playbook-and-from-imported-playbook-to-role-used-by-it/35425 "2021-06-28T14:41:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajaniesh\_Kaushikk](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Rajaniesh\_Kaushikk](https://forum.ansible.com/u/Rajaniesh_Kaushikk)\
**Post date:** [June 28, 2021, 2:41pm UTC](https://forum.ansible.com/t/how-to-pass-variable-to-another-playbook-and-from-imported-playbook-to-role-used-by-it/35425/1 "2021-06-28T14:41:36Z")

</div>

Hi,

I have two playbooks

Playbook1

- name: Create Azure VM  
hosts: localhost

- name: Include Delete IP address  
import\_playbook: deleteIPaddress.yml

Vars:  
ipaddress:“{{ipaddress}}”

Now in this imported playbook deleteIPaddress.yml I am using role and I want to pass the IP address variable to the role so role can use it.

- name: Include Delete IP address

-role UserIPAddress

How to do it?  
Regards  
Rajaniesh
