Feature: allow to use the username from UI as value of environment variables
Related to
Web-Frontend (what users interact with), Ansible (task execution), Configuration
Impact
nice to have
Missing Feature
User john runs a terraform task that creates a VM and VM name should include name john-, we can use :
- Environment with variable called
TF_VAR_semaphoreuser-var.semaphoreuseris accessible in terraform automatically - but environment does not belong toJohnit belongs to the project so this is not usable at scale - Survey variable - every task need to have survey variable
semaphoreuserasking user to fill its own username - there is nothing preventing to give any other value. Also it is tedious to ask semaphore user name at every task execution
Implementation
- ability for environment and have value set by UI
- example environment I need the value is
usernamefromGET /api/user
If the value of the variable is not resolved when running a task then - the variable should not exist at all (default empty value is not wanted - task failure is expected if variable does not resolve to username)
Design
No response
I have a use case for this too. I'm setting up a multi-user Ansible controller with both Semaphore and ARA
ARA has an env variable, ARA_RECORD_USER_NAME, to set the username it records.
I'd like a way to set this to the currently logged in user.
Could some amount of templating be added to Variable Groups to accomplish this? Something like this
Hi @winbornejw it is interesting idea. I like it but with different implementation.