# environment variables

**URL:** <https://forum.ansible.com/t/environment-variables/18081>\
**Category:** Ansible Project\
**Created:** [April 24, 2015, 5:21pm UTC](https://forum.ansible.com/t/environment-variables/18081 "2015-04-24T17:21:08Z")\
**Posts on this page:** 3\
**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 24, 2015, 5:21pm UTC](https://forum.ansible.com/t/environment-variables/18081/1 "2015-04-24T17:21:08Z")

</div>

Hello

I am trying to use environment variables in my playbook instead of static entries.  
For example username, password etc. for Openstack.

I have seen this page  
[http://docs.ansible.com/playbooks\_environment.html](http://docs.ansible.com/playbooks_environment.html)  
But I don’t understand how to pass specific environment variables inside a playbook.

In case of Openstack we have  
OS\_PASSWORD=Password1  
OS\_AUTH\_URL=[http://controller:35357/v2.0](http://controller:35357/v2.0)  
OS\_USERNAME=demo  
OS\_TENANT\_NAME=demo

How can I assign these in a playbook such as this  
[http://pastebin.com/aMaihCme](http://pastebin.com/aMaihCme)

Thanks!

---

<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 24, 2015, 5:31pm UTC](https://forum.ansible.com/t/environment-variables/18081/2 "2015-04-24T17:31:54Z")

</div>

i think what you want is:  
lookup('env', 'OS\_PASSWORD')

---

<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 24, 2015, 6:41pm UTC](https://forum.ansible.com/t/environment-variables/18081/3 "2015-04-24T18:41:23Z")

</div>

Thanks Brian.
