semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Question: How to define variables in the task template?

Open joaomarcos85 opened this issue 11 months ago • 6 comments

Question

I am currently trying to migrate from Ansible AWX to Semaphore. In Ansible AWX I have the option to define variables only for a template. How can I do this in Semaphore?

Below is a screenshot of how I do it in Ansible AWX: Image

I found the option to create a Variable Groups in Semaphore, but I need to define the variables per template. If I am going to use Variable Groups I will need to create a Variable Group for each template.

Is there a simpler way to do this?

Related to

Ansible (task execution)

joaomarcos85 avatar Mar 29 '25 05:03 joaomarcos85

Looks like a useful ability. But currently it is not possible. I think we will add this in 2.14 as part of this feature: https://github.com/semaphoreui/semaphore/issues/2612

fiftin avatar Mar 31 '25 11:03 fiftin

Looks like a useful ability. But currently it is not possible. I think we will add this in 2.14 as part of this feature: #2612

@fiftin I opened a new pull request to add this feature: https://github.com/semaphoreui/semaphore/pull/2872

joaomarcos85 avatar Apr 01 '25 04:04 joaomarcos85

Hello @joaomarcos85 Did you manage to handle the extra variables?

@fiftin I saw that the pull request was rejected, what is current best practice to specify values of variables in task template? I would like to provide values to vars_prompt of my ansible playbook.

mickaeltardy avatar Nov 01 '25 09:11 mickaeltardy

@mickaeltardy you should use variable groups

fiftin avatar Nov 06 '25 07:11 fiftin

@mickaeltardy @fiftin Currently, Currently, for each template I have to create a variable group. Therefore, when I need to edit the extra variable values of a template, I have to search for the extra variable group and edit it. Since in my case I don’t reuse the same variable group in more than one template, I always need to have the same number of variable groups as the number of templates.

joaomarcos85 avatar Dec 01 '25 09:12 joaomarcos85

@mickaeltardy @fiftin If at least in the template edit modal there were an option to open the modal for editing the values of the selected variable group, it would already make it much easier to edit the template’s variable values

joaomarcos85 avatar Dec 01 '25 09:12 joaomarcos85