48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
---
|
|
- name: Test Network Scenarios
|
|
hosts: localhost
|
|
gather_facts: no
|
|
vars:
|
|
router_ip: "192.168.122.125"
|
|
worker_ips:
|
|
- "192.168.122.174"
|
|
- "192.168.122.203"
|
|
ssh_key: "../tf-cloud-init"
|
|
scenarios:
|
|
- baseline
|
|
- slow-connection
|
|
- high-latency
|
|
- packet-loss
|
|
- jitter
|
|
test_duration: 30
|
|
|
|
tasks:
|
|
- name: Run scenario tests
|
|
loop: "{{ scenarios }}"
|
|
loop_control:
|
|
loop_var: scenario
|
|
block:
|
|
- name: Apply scenario {{ scenario }}
|
|
command: "./apply_scenario.sh {{ router_ip }} {{ scenario }} {{ ssh_key }}"
|
|
args:
|
|
chdir: "{{ playbook_dir }}"
|
|
|
|
- name: Wait for scenario to stabilize
|
|
pause:
|
|
seconds: 10
|
|
|
|
- name: Collect metrics
|
|
command: >
|
|
./monitor_network.sh
|
|
"{{ worker_ips | join(',') }}"
|
|
"{{ ssh_key }}"
|
|
"{{ test_duration }}"
|
|
args:
|
|
chdir: "{{ playbook_dir }}"
|
|
|
|
- name: Archive metrics
|
|
command: >
|
|
mv metrics_*.csv
|
|
results/{{ scenario }}_{{ ansible_date_time.epoch }}/
|
|
args:
|
|
creates: "results/{{ scenario }}_{{ ansible_date_time.epoch }}/"
|