Skip to content

Commit

Permalink
add retries to guest_info tasks in case a vm is being modified
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemorency committed Aug 13, 2024
1 parent 95e5984 commit 005d49e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
name: "{{ test_vm_name }}"
validate_certs: false
register: vm_info
retries: 3
delay: 10

- name: Create Content Library
community.vmware.vmware_content_library_manager:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
name: "{{ item }}"
validate_certs: false
register: guest_info
retries: 3
delay: 10

- name: Check Properties Of VM {{ item }}
ansible.builtin.assert:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
validate_certs: no
name: "{{ provision_virtual_esxi_vms[0].name }}"
register: vm_info
ignore_errors: true
retries: 3
delay: 10

- name: Fail if VM is still present in vCenter
fail:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
validate_certs: "{{ provision_vm_validate_certs }}"
name: "{{ item.provision_vm_name }}"
register: vm_info
ignore_errors: true
retries: 3
delay: 10

- name: "Fail the task if the following VM exists: {{ item.provision_vm_name }}"
ansible.builtin.fail:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
validate_certs: "{{ provision_vm_validate_certs }}"
name: "{{ vm_name }}"
register: vm_info
retries: 3
delay: 10

- name: Fail the task if the VM doesn't exist
ansible.builtin.fail:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
validate_certs: "{{ provision_vm_validate_certs }}"
moid: "{{ vm_moid }}"
register: vm_info_updated_name
retries: 3
delay: 10

- name: Print vm_info_updated_name for {{ vm_moid }}
ansible.builtin.debug:
Expand Down

0 comments on commit 005d49e

Please sign in to comment.