kubespray/tests/cloud_playbooks
Arthur Outhenin-Chalandre 3311e0a296
tests: cleanup stale packet namespace automatically (#10245)
* tests: cleanup stale packet namespace automatically

Cancelled job on Gitlab can produce stale VMs as the delete playbook
will never be executed. This commits allow removing old vms by getting
all the namespace created from the same branch with an older pipeline
id.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* tests: cleanup stale packet namespace after 2 hours

This ensure that we don't have any packet namespace remaining for more
than 2 hours. All the jobs complete usually within 30min-1hour so 2
hours is enough to detect a stale namespace.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* tests: ignore vm cleanup failure

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* tests: use pipeline_id var instead of fetching namespace for cleanup packet vm

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

---------

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>
2023-06-26 00:57:08 -07:00
..
roles tests: cleanup stale packet namespace automatically (#10245) 2023-06-26 00:57:08 -07:00
templates Label k8s apps, adjust collect/upload info steps 2016-11-10 16:05:50 +01:00
cleanup-packet.yml tests: cleanup stale packet namespace automatically (#10245) 2023-06-26 00:57:08 -07:00
create-aws.yml Move to Ansible 3.4.0 (#7672) 2021-07-12 00:00:47 -07:00
create-do.yml Move to Ansible 3.4.0 (#7672) 2021-07-12 00:00:47 -07:00
create-gce.yml Move to Ansible 3.4.0 (#7672) 2021-07-12 00:00:47 -07:00
create-packet.yml PHASE 1 - Add Packet-CI playbook and configuration (#4537) 2019-04-16 14:49:07 -07:00
delete-aws.yml Rename ansible groups to use _ instead of - (#7552) 2021-04-29 05:20:50 -07:00
delete-gce.yml Move to Ansible 3.4.0 (#7672) 2021-07-12 00:00:47 -07:00
delete-packet.yml PHASE 1 - Add Packet-CI playbook and configuration (#4537) 2019-04-16 14:49:07 -07:00
upload-logs-gcs.yml Move to Ansible 3.4.0 (#7672) 2021-07-12 00:00:47 -07:00
wait-for-ssh.yml Drop Ansible support for v2.9 and v2.10 (#8925) 2022-06-09 07:07:42 -07:00