File: multiple_items_loop.yml

package info (click to toggle)
python-mitogen 0.3.0~rc1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,240 kB
  • sloc: python: 19,899; sh: 91; perl: 19; ansic: 18; makefile: 13
file content (36 lines) | stat: -rw-r--r-- 882 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# issue #414: verify behaviour of async tasks created in a loop.

- name: integration/async/multiple_items_loop.yml
  hosts: test-targets
  any_errors_fatal: true
  tasks:

  - name: start long running ops
    become: true
    shell: "{{item}}"
    async: 15
    poll: 0
    register: jobs
    with_items:
    - "sleep 3; echo hi-from-job-1"
    - "sleep 5; echo hi-from-job-2"

  - name: Ensure static files are collected and compressed
    async_status:
      jid: "{{ item.ansible_job_id }}"
    become: yes
    register: out
    until: out.finished
    retries: 30
    with_items:
      - "{{ jobs.results }}"

  - assert:
      that:
      - out.results[0].stdout == 'hi-from-job-1'
      - out.results[0].rc == 0
      - out.results[0].delta > '0:00:03'

      - out.results[1].stdout == 'hi-from-job-2'
      - out.results[1].rc == 0
      - out.results[1].delta > '0:00:05'