---
-# file: roles/cleanup/tasks/clean_images.yaml
+# file: tasks/clean_images.yaml
- name: Clean Docker Images
block:
---
-# file: roles/cleanup/tasks/kill_containers.yaml
+# file: tasks/kill_containers.yaml
- name: Kill Docker Containers
block:
- - name: Kill Container - Get Running Docker Containers
+ - name: Get Running Docker Containers
ansible.builtin.shell: "docker ps -a --filter name=DUT -q"
register: running_containers
changed_when: false
tags:
- kill-containers
- - name: Kill Container - Remove All Docker Containers
+ - name: Remove All Docker Containers
ansible.builtin.shell: "docker rm --force {{ item }}"
with_items: "{{ running_containers.stdout_lines }}"
tags:
- name: Kill LXC Containers
block:
- - name: Kill Container - Get Running LXC Containers
+ - name: Get Running LXC Containers
ansible.builtin.shell: "lxc-ls"
register: running_containers
changed_when: false
tags:
- kill-containers
- - name: Kill Container - Remove All LXC Containers
+ - name: Remove All LXC Containers
ansible.builtin.shell: "lxc-destroy --force -n {{ item }}"
with_items: "{{ running_containers.stdout_lines }}"
tags:
---
-# file: roles/cleanup/tasks/kill_process.yaml
+# file: tasks/kill_process.yaml
- name: Kill Process - {{ process }}
block:
- name: Safe Kill {{ process }}
ansible.builtin.shell: "kill {{ item }}"
with_items: "{{ running_processes.stdout_lines }}"
+ ignore_errors: true
tags:
- kill-process
---
-# file: roles/cleanup/tasks/main.yaml
-# purpose: Structured per server cleanup tasks.
-# - main:
-# - tg:
-# - Run tasks on TG servers only.
-# - Cleanup processes (T-Rex).
-# - sut:
-# - Run tasks on SUT servers only.
-# - Cleanup file leftovers (logs).
-# - Cleanup packages (VPP, Honeycomb).
-# - Cleanup processes (qemu, l3fwd, testpmd, docker, kubernetes)
-# - Cleanup interfaces.
-# - vpp_device
-# - Run tasks on vpp_device servers only.
-# - Reset SRIOV
-# - Docker image cleanup
-# - nomad
-# - Docker image cleanup
+# file: tasks/main.yaml
- name: tg specific
include_tasks: tg.yaml
---
-# file: roles/cleanup/tasks/nomad.yaml
+# file: tasks/nomad.yaml
- name: Host Cleanup
block:
vars:
images_to_prefetch_by_arch:
aarch64:
+ - "fdiotools/builder-ubuntu2204:prod-aarch64"
- "fdiotools/builder-ubuntu2004:prod-aarch64"
- - "fdiotools/builder-ubuntu1804:prod-aarch64"
- - "fdiotools/builder-centos8:prod-aarch64"
x86_64:
+ - "fdiotools/builder-ubuntu2204:prod-x86_64"
- "fdiotools/builder-ubuntu2004:prod-x86_64"
- - "fdiotools/builder-ubuntu1804:prod-x86_64"
- - "fdiotools/builder-debian10:prod-x86_64"
- - "fdiotools/builder-debian9:prod-x86_64"
- - "fdiotools/builder-centos8:prod-x86_64"
- - "fdiotools/builder-centos7:prod-x86_64"
+ - "fdiotools/builder-debian11:prod-x86_64"
tags:
- clean-images
---
-# file: roles/cleanup/tasks/remove_package.yaml
+# file: tasks/remove_package.yaml
-- name: Remove Package - Fix Corrupted APT
+- name: Fix Corrupted APT
ansible.builtin.shell: "dpkg --configure -a"
when:
- ansible_distribution == 'Ubuntu'
when:
- ansible_distribution == 'Ubuntu'
tags:
- - remove-package
+ - remove-package
\ No newline at end of file
---
-# file: roles/cleanup/tasks/sut.yaml
+# file: tasks/sut.yaml
- name: Host Cleanup
block:
---
-# file: roles/cleanup/tasks/tg.yaml
+# file: tasks/tg.yaml
- name: Host Cleanup
block:
---
-# file: roles/cleanup/tasks/vpp_device.yaml
+# file: tasks/vpp_device.yaml
- name: Host Cleanup
block: