# Displaying Return Values

**URL:** <https://forum.ansible.com/t/displaying-return-values/25604>\
**Category:** Ansible Project\
**Created:** [September 27, 2017, 5:39am UTC](https://forum.ansible.com/t/displaying-return-values/25604 "2017-09-27T05:39:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![C\_Bax](https://avatars.discourse-cdn.com/v4/letter/c/b4bc9f/32.png) [@C\_Bax](https://forum.ansible.com/u/C_Bax)\
**Post date:** [September 27, 2017, 5:39am UTC](https://forum.ansible.com/t/displaying-return-values/25604/1 "2017-09-27T05:39:23Z")

</div>

hello all,

i am having issues with getting return values from a module, honestly Im just unclear on how to call them

this is my code but when i execute the commands push but i get variable undefined from the debug [https://pastebin.com/gx0fBYCN](https://pastebin.com/gx0fBYCN)

---

<div class="post-metadata">

**Author:** ![Gildas\_Cotomale](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@Gildas\_Cotomale](https://forum.ansible.com/u/Gildas_Cotomale)\
**Post date:** [September 27, 2017, 6:53pm UTC](https://forum.ansible.com/t/displaying-return-values/25604/2 "2017-09-27T18:53:36Z")

</div>

Hi C Bax

First, you have to give a variable name (let’s say `command_result` for example) and register the output in it.  
Second, you inspect that variable with the debug module.

```auto
  tasks:
    - name: Pushing aliases to lab devices
      ios_config:
        src: ./templates/aliases.j2
        provider: "{{ cli }}"
      register: command_result
 
    - name: Displaying pushed configuration
      debug:
       var: commands_result

```
