简体   繁体   中英

Get access to Git-Revision in Ansible Playbook executed in Ansible Tower

We are using ansible tower to deploy software. The template and inventories are sourced from a Project which is based on a git repository.

For debugging purposes it would be great to be able to access the checked out revision in our playbook, so that we can eg write it to a file which we create during the deployment to be aware of the currently deployed version.

Is there a way to do this? So basically I would like to access the highlighted Revision in our playbook as ansible variable.

Ansible Tower 的屏幕截图,其中突出显示了修订版

Thanks for your help!

I found the solution myself:

tower_project_revision : The revision identifier for the source tree that this particular job uses (it is also the same as the job's field scm_revision)

https://docs.ansible.com/ansible-tower/latest/html/userguide/job_templates.html

Thank for your help!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM