Open Sopka opened 1 year ago
Hi @Sopka, there is currently no built-in way to do this in Task. Unfortunately, the rand
functions were removed from our templater to make it slimmer (since they rely on the rather large crypto/rand
package), so you are left to call an external program like uuidgen
for this task as you have suggested.
I will leave this issue open for now so that we can track it as a feature request. If others find themselves needing this functionality, please feel free to add a comment or 👍 the OP to let us know.
I need a constant random string available during the execution of one task. For example to append a suffix to a resource name.
My current workaround is to assign a dynamic variable and process the output further with a golang template:
I do this, because you cannot just export a shell variable at one command and re-use it in subsequent commands.
But this workaround is not OS independent and cumbersome.
Is there an easier way?