# task using raw module is always skipped with "VARIABLE NOT DEFINED!" error

**URL:** <https://forum.ansible.com/t/task-using-raw-module-is-always-skipped-with-variable-not-defined-error/22387>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [August 25, 2016, 5:08pm UTC](https://forum.ansible.com/t/task-using-raw-module-is-always-skipped-with-variable-not-defined-error/22387 "2016-08-25T17:08:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deep18](https://avatars.discourse-cdn.com/v4/letter/d/9de0a6/32.png) [@Deep18](https://forum.ansible.com/u/Deep18)\
**Post date:** [August 25, 2016, 5:08pm UTC](https://forum.ansible.com/t/task-using-raw-module-is-always-skipped-with-variable-not-defined-error/22387/1 "2016-08-25T17:08:34Z")

</div>

I am running winrm from my Mac with ansible:

here is my task thats causes a failure, don’t know what variable is being referred here, any help appreciated.

**_My task file for the playbook with the role:_**

- name: check if virtualenv exists

tags:

- InstallWiresharkService

- InstallVirtualEnv

win\_stat: path=“C:\Users\voiceqa\venv”

register: stat\_file

- name: debug stat

tags: InstallWiresharkService

debug: var=stat\_file.stat.exists

- name: install virtual environment

tags:

- InstallWiresharkService

- InstallVirtualEnv

command: virtualenv C:\Users\voiceqa\venv

any\_errors\_fatal: true

when: not stat\_file.stat.exists

register: out

- debug: var=out.stderr\_lines

tags: InstallWiresharkService

**_playbook Run output snippet at error:_**

ok: [10.203.189.4] =\> {“changed”: false, “invocation”: {“module\_name”: “win\_stat”}, “stat”: {“exists”: false}}

Perform task: TASK: windows : debug stat (y/n/c): y

Perform task: TASK: windows : debug stat (y/n/c): \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [windows : debug stat] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

**task path: /Users/dnveer/p4\_ws/comms/qa/common/python/projects/dlb-ansible-utils/main/dlb-ansible-utils/src/dlb\_ansible\_utils/playbooks/roles/windows/tasks/main.yml:10**

ok: [10.203.189.4] =\> {

“stat\_file.stat.exists”: false

}

Perform task: TASK: windows : install virtual environment (y/n/c): y

Perform task: TASK: windows : install virtual environment (y/n/c): \*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [windows : install virtual environment] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

**task path: /Users/dnveer/p4\_ws/comms/qa/common/python/projects/dlb-ansible-utils/main/dlb-ansible-utils/src/dlb\_ansible\_utils/playbooks/roles/windows/tasks/main.yml:14**

skipping: [10.203.189.4] =\> {“changed”: false, “invocation”: {“module\_args”: {“\_raw\_params”: “virtualenv C:\Users\voiceqa\venv”}, “module\_name”: “raw”}, “skipped”: true}

Perform task: TASK: windows : debug (y/n/c): y

Perform task: TASK: windows : debug (y/n/c): \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [windows : debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

**task path: /Users/dnveer/p4\_ws/comms/qa/common/python/projects/dlb-ansible-utils/main/dlb-ansible-utils/src/dlb\_ansible\_utils/playbooks/roles/windows/tasks/main.yml:23**

ok: [10.203.189.4] =\> {

“out.stderr\_lines”: “VARIABLE IS NOT DEFINED!”

}

Perform task …

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 25, 2016, 6:55pm UTC](https://forum.ansible.com/t/task-using-raw-module-is-always-skipped-with-variable-not-defined-error/22387/2 "2016-08-25T18:55:18Z")

</div>

stderr\_lines does not exist.

Run a  
- debug: var=out

and you'll see what is avaialble.  
stderr\_lines is not one of them, but you will have out.stderr, out.stdout and out.stdout\_lines and some others.
