ragpm
ragpm
found a way using like that: ``` unicast_src_ip: "{{ (groups['all'].index(inventory_hostname) == 0) | ternary(hostvars[groups['all'][0]].access_ip,hostvars[groups['all'][1]].access_ip) }}" unicast_peers: - "{{ (groups['all'].index(inventory_hostname) == 0) | ternary(hostvars[groups['all'][1]].access_ip,hostvars[groups['all'][0]].access_ip) }}" ``` Is there anothe way to...
exact. My group is simple: ``` all: hosts: hap1: ansible_host: 10.0.2.31 ip: 10.0.2.31 access_ip: 10.0.2.31 ansible_user: ansible hap2: ansible_host: 10.0.2.32 ip: 10.0.2.32 access_ip: 10.0.2.32 ansible_user: ansible ``` My vars: ```...