0
我有以下inventory
文件:提取服務器IP
[group_01]
g01_h01 ansible_ssh_host='10.1.0.1'
g01_h01 ansible_ssh_host='10.1.0.2'
[group_02]
g02_h01 ansible_ssh_host='10.2.0.1'
g02_h01 ansible_ssh_host='10.2.0.2'
[group_03:children]
group_01
group_02
[group_03:vars]
fst_group2={{groups['group_02'][0]}}
snd_group1={{groups['group_01'][1]}}
我想,在我的playbook
變量有以下值:
fst_group2=10.2.0.1
snd_group1=10.1.0.2
相反,我得到:
fst_group2=g02_h01
snd_group1=g01_h02
任何想法,解決方法?