I have a list:
awx_credentials:
- name: "user1"
password: "123"
- name: "user2"
password: "123"
- name: "user3"
password: "123"
- name: "user4"
password: "123"
In one task I need to get the name of the user2
name like this:
- name: "My test"
awx.awx.execution_environment:
name: "My EE"
image: "quay.io/ansible"
credential: "{{ awx_credentials[1].name }}"
But if I change the order of the list, this will not work.
How could I get the value of name
searching for user2
into the list?
Thank you in advance!