Hello,
I need the reference variable type in the "Create Release" task.
Because this task must call a child template stored in a variable (${template_child}).
The variable ${template_child} is conditioned (e.g. template new install or template update).
The child templates have as an input of release the valorization of variable type reference type Ansible Automation Platform Controller: Server.
At the moment it is impossible for me to do so.
core.createRelease:
input template field : ${template_child}
and for the Variable addition only the types:
-Test
-Password
-Checkbox
-number
-list
-date
-Key-value-map
-set
are possible and not by reference
by: de monplanet c. | 2 months ago | Templates & Releases
Comments
Thank you for your feature request and detailed explanation of the issue you’re facing regarding the use of the Create Release task with a Reference variable type. I understand the need to pass Reference variables when working with unknown child templates, which isn’t currently possible with the manually added variables.
Given the complexity of handling value provider-based variables (Listbox, Multi-select, Reference) that require a scoped security context, here are three potential alternative approaches that may help resolve your issue more efficiently:
Approach 1: Folder and Global-Scoped Reference Variables (Release 24.3)
With the upcoming Release 24.3, there will be support for folder-scoped and global-scoped Reference variables. This means both the parent and child templates can directly reference a folder-scoped Reference variable without needing to pass it between templates. This would eliminate the need to pass Reference variables from the parent to the child template, as both can access the same folder-scoped variable.
---
Approach 2: Auto-Rendering of Child Template Variables
When the Create Release task is opened in the Task Drawer, there’s a useful trick: if the ${template_child} variable contains the ID of a valid template candidate, the UI will automatically render the list of that template’s variables, without needing to add them manually to the Create Release task. This would bypass the need for manually adding and keeping in sync the list of variables by leveraging the automatic rendering of child template variables.
---
Approach 3: Passing String Variable to Reference Variable
Inside the Create Release task, we could tweak the logic to allow passing String variable into the child template’s Reference variable. In this scenario, the Create Release task String variable would have the same name as the child template’s Reference variable. The Create Release task String variable could be bound to the parent template’s Reference variable.
Please let us know if any of these approaches could work for your case. We’re happy to explore further refinements if needed.
Hi,
Thank you for your feelback and sorry for my late reply.
Approach 1: Very good that this type of variable is in the global and folder scope .
But this implies that there can only be one release (child and parent) at the same time.
---
Approach 2: If the variable ${template_child} contains the model ID. As long as put the template ID in the Template field of the Create Release task.
---
Approach 3:It's a workaround that I already use.
I was just proposing an evolution and a need for my case.
---
So I can understand that you can't do it
Approach 1, yes, it is for the use case when the connected group of releases in a specific folder are using the same Ansible server.
Approach 2, yes if the populated ${template_child} is then assigned to the Template field of the Create Release task, the rendering of variables will work in full respect.
Approach 3, we believe that currently it does not work yet as it’s not possible to assign a Create Release task String variable into a child release Reference variable. We can remove this limitation if you are interested.
For the full solution of what is being requested, we would monitor the upvotes by other customers.