ansible 2.7.4
Ниже работает:
tasks:
- name: Launch instance
ec2:
key_name: "{{ keypair }}"
.
.
register: ec2
- name: Add new instance to host group
add_host:
hostname: "{{ item.public_ip }}"
groupname: launched
with_items: "{{ ec2.instances }}"
Но ниже не
tasks:
- name: Launch instance
ec2:
key_name: "{{ keypair }}"
.
.
register: "{{ register }}"
- name: Add new instance to host group
add_host:
hostname: "{{ item.public_ip }}"
groupname: launched
with_items: "{{ register.instances }}"
В результате:
fatal: [localhost]: FAILED! => {"msg": "'ansible.parsing.yaml.objects.AnsibleUnicode object' has no attribute 'instances'"}
Не уверен, связано ли это с этим: https://github.com/ansible/ansible/issues/19803
Большое спасибо за ответы