# Ansible Tower: Passing extra variables from one workflow template to other

**URL:** <https://forum.ansible.com/t/ansible-tower-passing-extra-variables-from-one-workflow-template-to-other/32791>\
**Category:** AWX Project\
**Created:** [April 27, 2020, 1:51pm UTC](https://forum.ansible.com/t/ansible-tower-passing-extra-variables-from-one-workflow-template-to-other/32791 "2020-04-27T13:51:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaliyug\_Antagonist](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@Kaliyug\_Antagonist](https://forum.ansible.com/u/Kaliyug_Antagonist)\
**Post date:** [April 27, 2020, 1:51pm UTC](https://forum.ansible.com/t/ansible-tower-passing-extra-variables-from-one-workflow-template-to-other/32791/1 "2020-04-27T13:51:28Z")

</div>

**Ansible 2.9.2**  
**Tower 3.6.1**

There are two Bitbucket repositories viz. **bitbucketconfigurator** and **sonarconfigurator** which contain playbooks to configure Bitbucket and Sonarqube projects, respectively. Here, showing just the bitbucketConfigurator\*\*:\*\*

 ![bitbucketconfigurator-playbooks.png](https://us1.discourse-cdn.com/ansible/original/2X/d/d89d614072ab15c7ccaee646cc26e91dad9388b8.png)

In the above project, there is a **group\_vars/all yaml** file as follows\*\*(note the entry bitbucket\_token: “{{ PAT\_admin\_admin }}”):\*\*

`

# Defaults used for branch access and restrictions

# Global vars used for rest api

bitbucket\_base\_url: ‘[https://git.net](https://git.net)’  
bitbucket\_rest\_base\_endpoint: ‘rest/api/1.0/projects’  
bitbucket\_rest\_url: “{{ bitbucket\_base\_url }}/{{ bitbucket\_rest\_base\_endpoint }}”  
bitbucket\_branch\_rest\_endpoint: “rest/branch-permissions/2.0/projects”  
bitbucket\_branching\_url: “{{ bitbucket\_base\_url }}/rest/branch-utils/1.0/projects”  
sonar\_for\_bitbucket\_base\_endpoint: ‘rest/sonar4stash/1.0/projects’  
bitbucket\_token: “{{ PAT\_admin\_admin }}”  
bitbucket\_rest\_api\_latest: ‘rest/api/latest’  
bitbucket\_project\_name\_lc: “{{ bitbucket.project.name | lower }}”  
bitbucket\_repository\_name\_lc: “{{ bitbucket.project.repository.name | lower }}”  
`

The list of **job templates** , an example is shown further, below:

 ![job-templates-corresponding-to-playbooks.png](https://us1.discourse-cdn.com/ansible/original/2X/b/b3b1a6916be82d1178bed6b8d1fb40aa852ea395.png)

As an example, let’s consider the **bb\_configure** job template I am using ‘Extra Variables’ to pass a yml file/dictionary e.g:

 ![extra-vars-passed-to-job-templates.png](https://us1.discourse-cdn.com/ansible/original/2X/5/59802157e558777b89837e809ddfbed6d8b0b7a6.png)

Here is the list of all the workflow templates, I will summarize their usage subsequently:

 ![work-flow-templates.png](https://us1.discourse-cdn.com/ansible/original/2X/b/baed566a82c0c43799f6f0493f5fa464f318d730.png)

I tested the bitbucketconfigurator playbooks in a single workflow viz. wt-bitbucket. It runs successfully. **Note that it uses no-arg versions of the individual playbooks i.e the config yaml file is passed to the wt-bitbucket and NOT the individual playbooks.**

 ![workflow-template-bitbucket.png](https://us1.discourse-cdn.com/ansible/original/2X/a/a0a2c7f59e334e1eba7dffc94ae1fbc51eef92cf.png)

In the above workflow template, the extra vars are used:

 ![workflow-template-extra-vars.png](https://us1.discourse-cdn.com/ansible/original/2X/9/9c6d9c72fbf236f46dad0ff9230b005abfc4b6aa.png)

Now, I am using the **wk\_onboarding\_pipeline as a ‘master’ workflow template** which invokes the no-arg versions of the workflow templates:

 ![master-workflow-template.png](https://us1.discourse-cdn.com/ansible/original/2X/1/1819aaccef5c797cbed82dcf1501a16090237690.png)

This ‘master’ template now has the config yaml file, also, note the entry **PAT\_admin\_admin:**

 ![master-workflow-template-extra-vars.png](https://us1.discourse-cdn.com/ansible/original/2X/a/ad0c6649a440f19dbfeb0ffd702fee54cee45720.png)

**Issue:**  
When I run this ‘master’ template, the first playbook of the first workflow template fails as it is **unable to access the ‘PAT\_admin\_admin’ passed in the extra vars.**

 ![error-master-template.png](https://us1.discourse-cdn.com/ansible/original/2X/a/a9f448ad122b4d4a8c74c0ad96e723a036d9eb05.png)

Am I making a mistake in the invocation or have I incorrectly configured the workflow templates within a workflow template?

---

<div class="post-metadata">

**Author:** ![Kaliyug\_Antagonist](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@Kaliyug\_Antagonist](https://forum.ansible.com/u/Kaliyug_Antagonist)\
**Post date:** [April 27, 2020, 1:55pm UTC](https://forum.ansible.com/t/ansible-tower-passing-extra-variables-from-one-workflow-template-to-other/32791/2 "2020-04-27T13:55:04Z")

</div>

In case the images seem to be a trouble, the post is duplicated on [Stackoverflow](https://stackoverflow.com/questions/61460263/ansible-tower-passing-extra-variables-from-one-workflow-template-to-other).
