Get Ansible Job ID inside playbook

2,860 views
Skip to first unread message

Ivo Hechmann

unread,
May 28, 2015, 9:06:10 AM5/28/15
to ansible...@googlegroups.com
Hello;

How can I retrieve the current job id? Want to create a Jira Issue using the jira module and add the ansible job ID as description...

Thank you very much

Ivo 

James Cammarata

unread,
May 28, 2015, 2:46:22 PM5/28/15
to ansible...@googlegroups.com
Hi Ivo, is this a Tower question? In ansible core, the "job id" only exists for async tasks.

Thanks!

James Cammarata
Director, Ansible Core Engineering
github: jimi-c

--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/730658e3-44aa-42d7-9963-5aa3353f210d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ivo Hechmann

unread,
May 29, 2015, 4:04:35 AM5/29/15
to ansible...@googlegroups.com
Hello James;

Yes, in tower, each job has its ID in the joblist. If a job results in creating a Jira-Issue, it would be nice to link in the Jira Issue to the ansible Job. Is there a way to realize this?

Thank you very much

Ivo 

benno joy

unread,
May 29, 2015, 4:24:28 AM5/29/15
to ansible...@googlegroups.com
Hi Ivo,

For future tower queries can you please post it at 'support.ansible.com' as this list is for core ansible. following are variables exposed by tower to an ansible playbook.

{"tower_job_template_name", "tower_job_id", "tower_user_id", "tower_job_template_id", "tower_user_name", "tower_job_launch_type"}


- Benno



Ivo Hechmann

unread,
May 29, 2015, 7:29:26 AM5/29/15
to ansible...@googlegroups.com
Hi Benno, thank you very much, works fine, also thanks for support.ansible.com

Ivo 
Reply all
Reply to author
Forward
0 new messages