title: Ansible: Can we run an include playbook Asynchronously?
body: <p>I'm interested to learn if Ansible can run an included playbook asynchronously?</p>
  
  <p>Basically what I'm trying to do is run a task "Fire and forget, check on it later." When I check on it later I also want to send a slack notification with the result. </p>
  
  <p>However I've notice the included playbook for slack notification takes a little longer than expected to complete and hence it holds up the rest of the playbook. </p>
  
  <p>What I want is to async the included playbook for slack notification so that the current playbook continues.</p>
  
  <p>For instance I have a playbook.yml file that looks like:</p>
  
  <pre><code>- hosts: localhost
  
    tasks:
    - name: Fire and forget task
      shell: some_task.sh
             chdir=/tmp/
      register: fire_and_forget_task
      async: 3600
      poll: 0
  
  
    - name: Check on fire and forget task
      async_status: jid={{ fire_and_forget_task.ansible_job_id }}
      register: task_status
      until: task_status.finished
      retries: 100
      ignore_errors: yes
  
  
    - name: Send slack success msg
      include: slack.yml msg="Fire and forget task SUCCESS"
      when: task_status.stdout is defined and 
            'SUCCESS' in fire_and_forget_task.stdout
      async: 3600
      poll: 0
  
  
    - name: Send slack failed msg
      include: slack.yml msg="Fire and forget task FAILED"
      when: task_status.stdout is defined and 
            'FAILED' in fire_and_forget_task.stdout
      async: 3600
      poll: 0
  </code></pre>
  
  <p>My slack.yml file looks like:</p>
  
  <pre><code>  - name: Send notification message via Slack
      local_action:
        module: slack
        token: &lt;REDACTED&gt;
        attachments:
        - text: "{{ msg }}"
          color: "#83F52C"
          title: "Ansible Status {{ lookup('pipe','date') }}"
  </code></pre>
  
  <p>With the above playbook, the "Send slack success msg" task takes an awfully long time to execute for a simple task like that. It seems its not running asynchronously even though I have explicitly stated it should.</p>
  
  <p>What is the best way to achieve the desired outcome?
  Thank you.</p>