Skip to content

Commit

Permalink
Refactor vm_count in tests provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
VannTen committed Dec 15, 2023
1 parent 3370a4a commit e3a971b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 0 additions & 4 deletions tests/cloud_playbooks/roles/packet-ci/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
- name: "Include custom vars for ci job: {{ ci_job_name }}"
include_vars: "../files/{{ ci_job_name }}.yml"

- name: Set VM count needed for CI test_id
set_fact:
vm_count: "{%- if mode in ['separate', 'separate-scale', 'ha', 'ha-scale', 'ha-recover', 'ha-recover-noquorum'] -%}{{ 3 | int }}{%- elif mode == 'all-in-one' -%}{{ 1 | int }}{%- else -%}{{ 2 | int }}{%- endif -%}"

- name: Cleamup old VMs
import_tasks: cleanup-old-vms.yml

Expand Down
12 changes: 12 additions & 0 deletions tests/cloud_playbooks/roles/packet-ci/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
_vm_count_dict:
separate: 3
separate-scale: 3
ha: 3
ha-scale: 3
ha-recover: 3
ha-recover-noquorum: 3
all-in-one: 1
default: 2

vm_count: "{{ _vm_count_dict[mode | d('default')] }}"

0 comments on commit e3a971b

Please sign in to comment.