Skip to content

Commit

Permalink
Wait for cloud-init to complete to reduce the chance of race conditions.
Browse files Browse the repository at this point in the history
  • Loading branch information
aitorpazos committed Aug 1, 2024
1 parent 26f3909 commit 354434e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions molecule_qemu/playbooks/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Check failure on line 443 in molecule_qemu/playbooks/create.yml

View workflow job for this annotation

GitHub Actions / lint-ansible

fqcn[action-core]

Use FQCN for builtin module actions (add_host).

Check failure on line 443 in molecule_qemu/playbooks/create.yml

View workflow job for this annotation

GitHub Actions / lint-ansible

name[missing]

All tasks should be named.
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

Check failure on line 455 in molecule_qemu/playbooks/create.yml

View workflow job for this annotation

GitHub Actions / lint-ansible

no-changed-when

Commands should not change things if nothing needs doing.
ansible.builtin.command: "cloud-init status --wait"
register: cloud_init_status
delegate_to: "{{ item.name }}"
loop: "{{ molecule_instances }}"

0 comments on commit 354434e

Please sign in to comment.