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**:**
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:
As an example, let’s consider the bb_configure job template I am using ‘Extra Variables’ to pass a yml file/dictionary e.g:
Here is the list of all the workflow templates, I will summarize their usage subsequently:
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.
In the above workflow template, the extra vars are used:
Now, I am using the wk_onboarding_pipeline as a ‘master’ workflow template which invokes the no-arg versions of the workflow templates:
This ‘master’ template now has the config yaml file, also, note the entry PAT_admin_admin:
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.
Am I making a mistake in the invocation or have I incorrectly configured the workflow templates within a workflow template?