Below is my part of my meta file in ansible.
---
dependencies:
- { role: nomad-agent,
nomad_agent_type: client,
client_dc: "{{ 'jira' if 'jira-app' in host_name else host_env }}",
nomad_servers: ["{{ nomad1_ip }}","{{ nomad2_ip }}","{{ nomad3_ip }}"],
tags: "nomad-agent"
}
In client_dc option, I need to add elif in such a manner that client_dc would be assigned to "jira-next" if 'jira-next' is found in the hostname. So, if 'jira-app' is found in hostname, client_dc: jira elif 'jira-next-app' is found in hostname, client_dc: jira-next otherwise client_dc: host_name (variable pre assigned in variable file)
How can I achieve that?