# Job Templates from source control??

**URL:** <https://forum.ansible.com/t/job-templates-from-source-control/31281>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [September 14, 2019, 5:31pm UTC](https://forum.ansible.com/t/job-templates-from-source-control/31281 "2019-09-14T17:31:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [September 14, 2019, 5:31pm UTC](https://forum.ansible.com/t/job-templates-from-source-control/31281/1 "2019-09-14T17:31:35Z")

</div>

Is tower/awx capable of importing job templates from source control? Either through github or maybe a push through Jenkins. So far the only things I can get to pull from source our inventories and playbooks. I’m unable to find any doc’s that talk about what all an be sourced for tower/awx. Any thoughts or suggestions is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![barry\_kelliher1](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@barry\_kelliher1](https://forum.ansible.com/u/barry_kelliher1)\
**Post date:** [September 14, 2019, 8:22pm UTC](https://forum.ansible.com/t/job-templates-from-source-control/31281/2 "2019-09-14T20:22:28Z")

</div>

Sort of . Towercli and presumably the replacement cli announced with awx 7. Can load and maintain templates. If you combine that with your git /git ci that's somewhere to start. It's not automatic and built in like the playbook fetch however out of the box

---

<div class="post-metadata">

**Author:** ![Fran\_Fitzpatrick](https://avatars.discourse-cdn.com/v4/letter/f/7ab992/32.png) [@Fran\_Fitzpatrick](https://forum.ansible.com/u/Fran_Fitzpatrick)\
**Post date:** [September 14, 2019, 10:02pm UTC](https://forum.ansible.com/t/job-templates-from-source-control/31281/3 "2019-09-14T22:02:38Z")

</div>

You can alternatively use tower\_job\_template module as part of a playbook to configure job templates.

---

<div class="post-metadata">

**Author:** ![Nivedita](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@Nivedita](https://forum.ansible.com/u/Nivedita)\
**Post date:** [September 20, 2019, 6:41am UTC](https://forum.ansible.com/t/job-templates-from-source-control/31281/4 "2019-09-20T06:41:52Z")

</div>

Yes tower/AWX is cabaple of importing jobs from source control. AWX can import jobs from : subversion, mercurial, git, SVN etc  
Importing jobs from subversion (Git):  
Execution Steps :

1. Login to AWX dashboard with any user.
2. Create inventory and add host.
3. Create credential.
4. Now click on projects and create a project ‘Project\_name’ with SCM type as ‘Subversion’.
5. Write playbook in ‘git’ repository
6. Provde SCM url of your repository where playbook is available.
7. Create a job template and select created project in the project parameter. It will automatically show the list of all playbooks available at provided url.

While importing jobs from mercurial follow below steps:

1. Crate a credential and provide username and password of mercurial account.
2. Select credential type as ‘source control’
3. Create project and select project type as mercurial.
4. Provide SCM url of repository where your playbook exists.
5. Select SCM credential which is created in step 1.
6. Create a job and select created project, it will show all the playbooks available at your repository.

---

<div class="post-metadata">

**Author:** ![klaasdemter](https://avatars.discourse-cdn.com/v4/letter/k/3bc359/32.png) [@klaasdemter](https://forum.ansible.com/u/klaasdemter)\
**Post date:** [September 20, 2019, 2:59pm UTC](https://forum.ansible.com/t/job-templates-from-source-control/31281/5 "2019-09-20T14:59:13Z")

</div>

you can add job templates through api, for example with ansible: [https://github.com/redhat-cop/infra-ansible/tree/master/roles/ansible/tower](https://github.com/redhat-cop/infra-ansible/tree/master/roles/ansible/tower)

---

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [September 20, 2019, 3:11pm UTC](https://forum.ansible.com/t/job-templates-from-source-control/31281/6 "2019-09-20T15:11:14Z")

</div>

Thank you, very helpful.

---

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [September 20, 2019, 3:11pm UTC](https://forum.ansible.com/t/job-templates-from-source-control/31281/7 "2019-09-20T15:11:48Z")

</div>

Thank you.
