1. 场景 取到oldmaster组的第一个master的ip 2. ansible脚本 - name: check etcd debug: msg: "{{ hostvars[groups['oldmaster'][0]]['ip'] }}" 3. 执行结果