# environment parameter

**URL:** <https://forum.ansible.com/t/environment-parameter/19644>\
**Category:** Ansible Project\
**Created:** [October 28, 2015, 8:12pm UTC](https://forum.ansible.com/t/environment-parameter/19644 "2015-10-28T20:12:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guy\_Matz1](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@Guy\_Matz1](https://forum.ansible.com/u/Guy_Matz1)\
**Post date:** [October 28, 2015, 8:12pm UTC](https://forum.ansible.com/t/environment-parameter/19644/1 "2015-10-28T20:12:15Z")

</div>

Hi! I’m trying to use the environment parameter in order to set JAVA\_HOME for a task . . .

I have this in my vars file:

wlst\_env:  
JAVA\_HOME: /opt/software/java/jdk1.6.0\_30

and this in my tasks file:

- include\_vars: main.yml

- debug: var=wlst\_env

- name: Call undeploy script  
command: “/opt/software/bea/wlserver\_10.3/common/bin/wlst.sh /tmp/{{ wlst\_repo }}/undeploy.py”  
environment: wlst\_env

The debug us saying that wlst\_env is set correctly;

```auto
{
  "var": {
    "wlst_env": {
      "JAVA_HOME": "/opt/software/java/jdk1.6.0_30"
    }
  },
 .
.
.
 "event": "Host OK"
}

```

but my “Call undeploy script” task fails with:  
The JDK wasn’t found in directory /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86\_64.  
Please edit the startWebLogic.sh script so that the JAVA\_HOME  
variable points to the location of your JDK

Which makes me think that JAVA\_HOME is not actually getting set! Any ideas what I’m doing wrong here?

Thanks a lot,

Guy

---

<div class="post-metadata">

**Author:** ![Guy\_Matz1](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@Guy\_Matz1](https://forum.ansible.com/u/Guy_Matz1)\
**Post date:** [October 29, 2015, 3:34pm UTC](https://forum.ansible.com/t/environment-parameter/19644/2 "2015-10-29T15:34:26Z")

</div>

any thoughts here? ☹

Thanks again . . .
