79389077

Date: 2025-01-26 18:35:09
Score: 0.5
Natty:
Report link

At least with Ansible 2.18.1, using local_action with async works with such a playbook:

- name: Demonstrate async local_action
  hosts:
    demohost
  tasks:
    - name: Start async task
      local_action:
        module: ansible.builtin.command
        cmd: sleep 20
      async: 100
      poll: 0
      register: async_out
    - name: Run concurrent task
      ansible.builtin.debug:
        msg: "Does not wait for async task"
    - name: Poll for async task completion
      local_action:
        module: ansible.builtin.async_status
        jid: "{{ async_out.ansible_job_id }}"
      register: async_poll_out
      until: async_poll_out.finished
      delay: 5
      retries: 10
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: eroen