# module development - getting task/runner object

**URL:** <https://forum.ansible.com/t/module-development-getting-task-runner-object/16297>\
**Category:** Ansible Developer\
**Created:** [September 22, 2014, 8:46am UTC](https://forum.ansible.com/t/module-development-getting-task-runner-object/16297 "2014-09-22T08:46:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawid.grzegorczyk](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dawid.grzegorczyk](https://forum.ansible.com/u/dawid.grzegorczyk)\
**Post date:** [September 22, 2014, 8:46am UTC](https://forum.ansible.com/t/module-development-getting-task-runner-object/16297/1 "2014-09-22T08:46:51Z")

</div>

Hello,

is there a way to get to current Task/Runner object from inside AnsibleModule? My playbook use case goes like this:

- name: My custom environment module  
myenvmodule: some\_param=some\_value  
environment: some\_env\_param: some\_env\_value1

In myenvmodule code i want to see what was declared in ‘environment: some\_env\_param: some\_env\_value1’ part of my playbook.

Anyone know how to access this data?

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [September 22, 2014, 9:10am UTC](https://forum.ansible.com/t/module-development-getting-task-runner-object/16297/2 "2014-09-22T09:10:27Z")

</div>

​What was declared in environment would be available as environment  
variables, so you could query those.

I think you could also pass environment as a module parameter​ if you need  
the exact set of it.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [September 22, 2014, 12:08pm UTC](https://forum.ansible.com/t/module-development-getting-task-runner-object/16297/3 "2014-09-22T12:08:56Z")

</div>

Yep, the os.getenv typical Python stuff would be your friend here.

The Runner class is not available for normal ansible modules (save Action plugins – which are a special beast and are there to implement special server side glue), as that is a programming construct that only exists on the remote end.
