My requirements are as follows: the deployment environment is transferred to the playbook as additional vars, for example: dev, qa or prod
I have a variable called DEPLOY_URL
Depending on the value of the env variable, DEPLOY_URL should change.
I tried to do the following:
DEPLOY_URLS:
"dev": "xyz"
"prod" : "abc"
"qa" : "123"
DEPLOY_URL: "{{DEPLOY_URLS['{{DEPLOY_ENV}}']}}"
The value will never be right. Is there a way to access the dictionary using another variable as a key? (Using YAML and possibly)
source
share