tower_id would be the job id for the job in which the template was run, so you need to pull that job id from somewhere. So basically, yeah, you'd have to create a new playbook to kick off the playbook you want to email the results on. Unfortunately, I'm short on time currently but here's the outline of what I'd do. It might not be the slickest way but it'd work.
1. API request to run template: https://docs.ansible.com/ansible-tower/3.5.0/html/towerapi/api_ref.html#/Job_Templates/Job_Templates_job_templates_launch_create - register the results into a job_run 2. Use the results from job_run to get the job id. Throw it into a debug task if you need to see the output of job_run. Usually it's something like job_run.results.id 3. API request to get the output from the job, using the job id: https://docs.ansible.com/ansible-tower/3.5.0/html/towerapi/api_ref.html#/Jobs/Jobs_jobs_read_0 - register the results into job_results 4. Use the mail module to email the contents of job_results -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/710fad28-a00e-4c9d-8ded-0b60ace6bde1%40googlegroups.com.
