Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fr: provide job_tags via Ansible job template task #11

Open
ltutar opened this issue Jan 25, 2021 · 2 comments
Open

fr: provide job_tags via Ansible job template task #11

ltutar opened this issue Jan 25, 2021 · 2 comments

Comments

@ltutar
Copy link

ltutar commented Jan 25, 2021

Hi,

{"inventory_id":2,"credentials":[3,11],"job_type":"run","limit":"","job_tags":"levent","skip_tags":"","extra_vars":{"git_access_protocol":"https","git_clone_url":"egypt.intern/cdaas/cdaas-demo-app.git","git_project_access_name":"cdaas-demo-app","git_project_access_token":"$encrypted$","test_directory":"/tmp/cypress","git_repository_name":"cdaas-demo-app"},"scm_branch":""}

job_tags is not part extra_vars. I would like to provide the job_tags via job template task.

Screenshot 2021-01-25 at 13 41 23

@Th3Heavy
Copy link

up, need to use tags too

@jeremydelmotte
Copy link

Hi guys,

You can add this in your "src/main/resources/synthetic.xml" in the "launch.Job" task =>
<property name="job_tags" category="input" kind="string" required="false" description="The tags to run" />

Then you add this in the "src/main/jython/run_job_template.py" =>

if task_vars['job_tags']:
vars_ = str(task_vars['job_tags'])
print("* set job_tags : {0}".format(vars_))
k_vars['job_tags'] = vars_

In my case, it works, I can now give Ansible Tower the tags to be run.

Hope I understand your use case.

Regards,

Jeremy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants