2019-08-29 01:47:39 +02:00
|
|
|
---
|
|
|
|
- hosts: localhosts
|
|
|
|
gather_facts: false
|
2020-01-24 15:18:08 +01:00
|
|
|
strategy: linear
|
|
|
|
run_once: yes
|
2019-08-29 01:47:39 +02:00
|
|
|
tasks:
|
2020-01-24 15:18:08 +01:00
|
|
|
- name: Clean base throttledir '{{ base_throttledir }}'
|
2019-08-29 01:47:39 +02:00
|
|
|
file:
|
|
|
|
state: absent
|
2020-01-24 15:18:08 +01:00
|
|
|
path: '{{ base_throttledir }}'
|
2019-08-29 01:47:39 +02:00
|
|
|
ignore_errors: yes
|
2020-01-24 15:18:08 +01:00
|
|
|
|
2019-08-29 01:47:39 +02:00
|
|
|
- name: Create throttledir '{{ throttledir }}'
|
|
|
|
file:
|
|
|
|
state: directory
|
|
|
|
path: '{{ throttledir }}'
|
2020-01-24 15:18:08 +01:00
|
|
|
loop: "{{ range(1, test_count|int)|list }}"
|
|
|
|
loop_control:
|
|
|
|
loop_var: test_id
|
|
|
|
vars:
|
|
|
|
test_count: "{{ 9 if lookup('env', 'SELECTED_STRATEGY') in ['free', 'host_pinned'] else 2 }}"
|
|
|
|
|
|
|
|
- hosts: localhosts
|
|
|
|
gather_facts: false
|
|
|
|
strategy: "{{ lookup('env', 'SELECTED_STRATEGY') }}"
|
|
|
|
tasks:
|
2019-08-29 01:47:39 +02:00
|
|
|
- block:
|
|
|
|
- name: "Test 1 (max throttle: 3)"
|
|
|
|
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 3"
|
2020-01-24 15:18:08 +01:00
|
|
|
vars:
|
|
|
|
test_id: 1
|
2019-08-29 01:47:39 +02:00
|
|
|
throttle: 3
|
|
|
|
- block:
|
|
|
|
- name: "Test 2 (max throttle: 5)"
|
|
|
|
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 5"
|
|
|
|
throttle: 5
|
2020-01-24 15:18:08 +01:00
|
|
|
vars:
|
|
|
|
test_id: 2
|
2019-08-29 01:47:39 +02:00
|
|
|
- block:
|
|
|
|
- name: "Test 3 (max throttle: 8)"
|
|
|
|
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 8"
|
|
|
|
throttle: 8
|
|
|
|
throttle: 6
|
2020-01-24 15:18:08 +01:00
|
|
|
vars:
|
|
|
|
test_id: 3
|
2019-08-29 01:47:39 +02:00
|
|
|
- block:
|
|
|
|
- block:
|
|
|
|
- name: "Test 4 (max throttle: 8)"
|
|
|
|
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 8"
|
|
|
|
throttle: 8
|
2020-01-24 15:18:08 +01:00
|
|
|
vars:
|
|
|
|
test_id: 4
|
2019-08-29 01:47:39 +02:00
|
|
|
throttle: 6
|
|
|
|
throttle: 12
|
|
|
|
throttle: 15
|
|
|
|
- block:
|
2020-01-24 15:18:08 +01:00
|
|
|
- name: "Teat 5 (max throttle: 3)"
|
2019-08-29 01:47:39 +02:00
|
|
|
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 3"
|
2020-01-24 15:18:08 +01:00
|
|
|
vars:
|
|
|
|
test_id: 5
|
2019-08-29 01:47:39 +02:00
|
|
|
throttle: 3
|
|
|
|
- block:
|
2020-01-24 15:18:08 +01:00
|
|
|
- name: "Test 6 (max throttle: 5)"
|
2019-08-29 01:47:39 +02:00
|
|
|
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 5"
|
|
|
|
throttle: 5
|
2020-01-24 15:18:08 +01:00
|
|
|
vars:
|
|
|
|
test_id: 6
|
2019-08-29 01:47:39 +02:00
|
|
|
- block:
|
2020-01-24 15:18:08 +01:00
|
|
|
- name: "Test 7 (max throttle: 6)"
|
2019-08-29 01:47:39 +02:00
|
|
|
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 6"
|
|
|
|
throttle: 6
|
2020-01-24 15:18:08 +01:00
|
|
|
vars:
|
|
|
|
test_id: 7
|
2019-08-29 01:47:39 +02:00
|
|
|
throttle: 3
|
|
|
|
- block:
|
|
|
|
- block:
|
2020-01-24 15:18:08 +01:00
|
|
|
- name: "Test 8 (max throttle: 8)"
|
2019-08-29 01:47:39 +02:00
|
|
|
script: "test_throttle.py {{throttledir}} {{inventory_hostname}} 8"
|
|
|
|
throttle: 8
|
2020-01-24 15:18:08 +01:00
|
|
|
vars:
|
|
|
|
test_id: 8
|
2019-08-29 01:47:39 +02:00
|
|
|
throttle: 6
|
|
|
|
throttle: 4
|
|
|
|
throttle: 2
|