# Fetching Register variables content to email

**URL:** <https://forum.ansible.com/t/fetching-register-variables-content-to-email/33583>\
**Category:** AWX Project\
**Tags:** windows, awx\
**Created:** [August 11, 2020, 11:01am UTC](https://forum.ansible.com/t/fetching-register-variables-content-to-email/33583 "2020-08-11T11:01:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![harsh\_chawda](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@harsh\_chawda](https://forum.ansible.com/u/harsh_chawda)\
**Post date:** [August 11, 2020, 11:01am UTC](https://forum.ansible.com/t/fetching-register-variables-content-to-email/33583/1 "2020-08-11T11:01:00Z")

</div>

Hello Everyone,

Is there anyway to fetch the content of register variable I defined in my playbook , after the job is successfully executed in AWX.

hosts: windows  
tasks:

- name: Search-only, return list of updates found (if any), log to c:\ansible\_wu1.txt  
win\_updates:  
category\_names:
- CriticalUpdates  
state: installed  
log\_path: c:\ansible\_wu1.txt  
reboot: yes  
**register: update\_result**

I want this **update\_result** values in AWX so that I can **email** the patches avaialble.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![iamroddo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iamroddo/32/321_2.png) [@iamroddo](https://forum.ansible.com/u/iamroddo)\
**Post date:** [August 11, 2020, 11:51am UTC](https://forum.ansible.com/t/fetching-register-variables-content-to-email/33583/2 "2020-08-11T11:51:35Z")

</div>

Hi Harsh,

I think you could do this by caching the result which I think you’d need to set using “set\_fact” and setting “cacheable” to be True and enable caching for the job\_template in AWX.

Rod

---

<div class="post-metadata">

**Author:** ![harsh\_chawda](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@harsh\_chawda](https://forum.ansible.com/u/harsh_chawda)\
**Post date:** [August 12, 2020, 4:42am UTC](https://forum.ansible.com/t/fetching-register-variables-content-to-email/33583/3 "2020-08-12T04:42:17Z")

</div>

Hello Rod,

Thanks for the solution , I will try it out and update.

Thanks again.

---

<div class="post-metadata">

**Author:** ![harsh\_chawda](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@harsh\_chawda](https://forum.ansible.com/u/harsh_chawda)\
**Post date:** [August 12, 2020, 11:01am UTC](https://forum.ansible.com/t/fetching-register-variables-content-to-email/33583/4 "2020-08-12T11:01:03Z")

</div>

Hello Rod,

I was able to gather facts for the host. But when i am customizing my notification body for email notification I am not able to include the variable and getting below error.

 ![](https://us1.discourse-cdn.com/ansible/original/2X/4/4439737ad134516a88ca58e7e9491816b6150a8c.png)

Can you please suggest how to include the variable **update\_result** value in here.

 ![](https://us1.discourse-cdn.com/ansible/original/2X/5/57bae4d8bbebb12de939dba70d90432f6c3efcdb.png)

Thanks,
