mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2026-08-08 23:13:19 +02:00
fix(molecule): always start guests in bounded batches
- Reuse bounded Vagrant startup batches when machine state already exists. - Avoid falling back to a concurrent five-guest startup during retries. - Keep instance reconciliation after all batches complete.
This commit is contained in:
committed by
Techno Tim
parent
5c288e8f3e
commit
83f205177d
@@ -18,12 +18,7 @@
|
|||||||
- create_batches | map('length') | max <= 2
|
- create_batches | map('length') | max <= 2
|
||||||
fail_msg: Bounded create batches do not match the configured default platforms.
|
fail_msg: Bounded create batches do not match the configured default platforms.
|
||||||
|
|
||||||
- name: Check for existing Vagrant machine state
|
- name: Generate the complete Vagrant configuration # noqa fqcn[action]
|
||||||
ansible.builtin.stat:
|
|
||||||
path: "{{ molecule_ephemeral_directory }}/.vagrant/machines"
|
|
||||||
register: vagrant_machine_state
|
|
||||||
|
|
||||||
- name: Generate the complete Vagrant configuration for a clean create # noqa fqcn[action]
|
|
||||||
vagrant:
|
vagrant:
|
||||||
instances: "{{ molecule_yml.platforms }}"
|
instances: "{{ molecule_yml.platforms }}"
|
||||||
default_box: "{{ molecule_yml.driver.default_box | default('generic/alpine316') }}"
|
default_box: "{{ molecule_yml.driver.default_box | default('generic/alpine316') }}"
|
||||||
@@ -32,7 +27,6 @@
|
|||||||
cachier: "{{ molecule_yml.driver.cachier | default(omit) }}"
|
cachier: "{{ molecule_yml.driver.cachier | default(omit) }}"
|
||||||
parallel: false
|
parallel: false
|
||||||
state: halt
|
state: halt
|
||||||
when: not vagrant_machine_state.stat.exists
|
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: Start clean Vagrant guests in bounded batches
|
- name: Start clean Vagrant guests in bounded batches
|
||||||
@@ -45,7 +39,6 @@
|
|||||||
loop: "{{ create_batches }}"
|
loop: "{{ create_batches }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item | join(', ') }}"
|
label: "{{ item | join(', ') }}"
|
||||||
when: not vagrant_machine_state.stat.exists
|
|
||||||
changed_when: true
|
changed_when: true
|
||||||
|
|
||||||
- name: Reconcile all instances and collect their connection configuration # noqa fqcn[action]
|
- name: Reconcile all instances and collect their connection configuration # noqa fqcn[action]
|
||||||
|
|||||||
Reference in New Issue
Block a user