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>
.

On Monday, April 27, 2020 at 3:52:27 PM UTC+2, Kaliyug Antagonist wrote:
>
> *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*:*
>
> [image: bitbucketconfigurator-playbooks.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'
>     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:
>
> [image: job-templates-corresponding-to-playbooks.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:
>
> [image: extra-vars-passed-to-job-templates.png]
>
>
>
> Here is the list of all the workflow templates, I will summarize their 
> usage subsequently:
>
> [image: work-flow-templates.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.*
>
> [image: workflow-template-bitbucket.png]
>
>
>
> In the above workflow template, the extra vars are used:
>
> [image: workflow-template-extra-vars.png]
>
>
>
> Now, I am using the *wk_onboarding_pipeline as a 'master' workflow 
> template* which invokes the no-arg versions of the workflow templates:
>
> [image: master-workflow-template.png]
>
>
>
> This 'master' template now has the config yaml file, also, note the entry 
> *PAT_admin_admin:*
>
> [image: master-workflow-template-extra-vars.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.*
>
> [image: error-master-template.png]
>
>
> Am I making a mistake in the invocation or have I incorrectly configured 
> the workflow templates within a workflow template?
>

-- 
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/16f4166a-379d-4db2-884e-35a86e653334%40googlegroups.com.

Reply via email to