ansible-role-visual-studio-code icon indicating copy to clipboard operation
ansible-role-visual-studio-code copied to clipboard

Need retry functionality in install_extensions

Open lask79 opened this issue 1 year ago • 0 comments

I am having sometimes 503 erros while installing the defined extensions for multiple machines and multiple users per machine at the same time.

I fixed this by adding the register, until, retries and delay. It would be great if you would add such functionality in install_extensions.yml so that the internal module would be called again in case of those errors.

---
- name: Install extensions
  become: yes
  become_user: "{{ item.0.username }}"
  visual_studio_code_install_extension:
    executable: "{{ visual_studio_code_exe }}"
    name: "{{ item.1 }}"
  with_subelements:
    - "{{ users }}"
    - visual_studio_code_extensions
    - skip_missing: yes
  loop_control:
    label: "{{ item.0.username }}: {{ item.1 }}"
  register: install_extension_result
  until: install_extension_result is successful
  retries: 5
  delay: 10

lask79 avatar Oct 11 '23 11:10 lask79