Here is my problem I need to use one variable \'target_host\' and then append \'_host\' to it\'s value to get another variable name whose value I need. If you look at my pl
You can try global array var:
regions:
us-east-1:
endpoint: rds.us-east-1.amazonaws.com
cn-north-1:
endpoint: rds.cn-north-1.amazonaws.com.cn
cn-northwest-1:
endpoint: rds.cn-northwest-1.amazonaws.com.cn
And use it to get value depending of another:
region_endpoint: "{{ regions[region].endpoint}}"
In your case:
target_host:
imap:
host: imap.max.com
smtp:
host: smtp.max.com
then:
region_endpoint: "{{ target_host[service].host}}"