Fetching Register variables content to email

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.

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

Hello Rod,

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

Thanks again.

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.

Can you please suggest how to include the variable update_result value in here.

Thanks,