Debian Codegraph @

test/integration/targets/throttle/test_throttle.yml

raw
1 ---
2 - hosts: localhost
3 tasks:
4 - name: throttle template that resolves to an integer
5 debug:
6 throttle: "{{ 1 }}"
7
8 - hosts: localhosts
9 gather_facts: false
10 strategy: linear
11 run_once: yes
12 tasks:
13 - name: Clean base throttledir '{{ base_throttledir }}'
14 file:
15 state: absent
16 path: '{{ base_throttledir }}'
17 ignore_errors: yes
18
19 - name: Create throttledir '{{ throttledir }}'
20 file:
21 state: directory
22 path: '{{ throttledir }}'
23 loop: "{{ range(1, test_count|int)|list }}"
24 loop_control:
25 loop_var: test_id
26 vars:
27 test_count: "{{ 9 if lookup('env', 'SELECTED_STRATEGY') in ['free', 'host_pinned'] else 2 }}"
28
29 - hosts: localhosts
30 gather_facts: false
31 strategy: "{{ lookup('env', 'SELECTED_STRATEGY') }}"
32 tasks:
33 - block:
34 - name: "Test 1 (max throttle: 3)"
35 script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 3"
36 vars:
37 test_id: 1
38 throttle: 3
39 - block:
40 - name: "Test 2 (max throttle: 5)"
41 script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 5"
42 throttle: 5
43 vars:
44 test_id: 2
45 - block:
46 - name: "Test 3 (max throttle: 8)"
47 script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 8"
48 throttle: 8
49 throttle: 6
50 vars:
51 test_id: 3
52 - block:
53 - block:
54 - name: "Test 4 (max throttle: 8)"
55 script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 8"
56 throttle: 8
57 vars:
58 test_id: 4
59 throttle: 6
60 throttle: 12
61 throttle: 15
62 - block:
63 - name: "Test 5 (max throttle: 3)"
64 script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 3"
65 vars:
66 test_id: 5
67 throttle: 3
68 - block:
69 - name: "Test 6 (max throttle: 5)"
70 script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 5"
71 throttle: 5
72 vars:
73 test_id: 6
74 - block:
75 - name: "Test 7 (max throttle: 6)"
76 script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 6"
77 throttle: 6
78 vars:
79 test_id: 7
80 throttle: 3
81 - block:
82 - block:
83 - name: "Test 8 (max throttle: 8)"
84 script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 8"
85 throttle: 8
86 vars:
87 test_id: 8
88 throttle: 6
89 throttle: 4
90 throttle: 2