diff --git a/molecule_qemu/playbooks/create.yml b/molecule_qemu/playbooks/create.yml index 7e262e3..c206629 100644 --- a/molecule_qemu/playbooks/create.yml +++ b/molecule_qemu/playbooks/create.yml @@ -438,3 +438,22 @@ content: "{{ instance_conf | to_json | from_json | to_yaml }}" dest: "{{ molecule_instance_config }}" mode: "0644" + + ### wait for cloud-init to complete ####################################### + - add_host: + name: "{{ item.name }}" + ansible_user: "root" + ansible_become: yes + ansible_ssh_host: "{{ molecule_instances_ipv4[item.name] }}" + ansible_ssh_port: "{{ item.network_ssh_port }}" + ansible_ssh_host_key_checking: no + ansible_ssh_private_key_file: "{{ ssh_keypair.filename }}" + loop: "{{ molecule_instances }}" + loop_control: + label: "{{ item.name }}" + + - name: Wait for Cloud-init to complete + ansible.builtin.command: "cloud-init status --wait" + register: cloud_init_status + delegate_to: "{{ item.name }}" + loop: "{{ molecule_instances }}"