fix(ansible): Cleanup macros 03/39003/1
authorpmikus <peter.mikus@protonmail.ch>
Wed, 7 Jun 2023 05:29:07 +0000 (05:29 +0000)
committerpmikus <peter.mikus@protonmail.ch>
Wed, 7 Jun 2023 05:29:07 +0000 (05:29 +0000)
Signed-off-by: pmikus <peter.mikus@protonmail.ch>
Change-Id: I53a530a07716e09b30b5401b313202460fb235c3

fdio.infra.ansible/roles/cleanup/tasks/clean_images.yaml
fdio.infra.ansible/roles/cleanup/tasks/kill_containers.yaml
fdio.infra.ansible/roles/cleanup/tasks/kill_process.yaml
fdio.infra.ansible/roles/cleanup/tasks/main.yaml
fdio.infra.ansible/roles/cleanup/tasks/nomad.yaml
fdio.infra.ansible/roles/cleanup/tasks/remove_package.yaml
fdio.infra.ansible/roles/cleanup/tasks/sut.yaml
fdio.infra.ansible/roles/cleanup/tasks/tg.yaml
fdio.infra.ansible/roles/cleanup/tasks/vpp_device.yaml

index f377871..76704ab 100644 (file)
@@ -1,5 +1,5 @@
 ---
-# file: roles/cleanup/tasks/clean_images.yaml
+# file: tasks/clean_images.yaml
 
 - name: Clean Docker Images
   block:
index 22239b1..dc739eb 100644 (file)
@@ -1,16 +1,16 @@
 ---
-# 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:
index bad5ef5..9ab98a8 100644 (file)
@@ -1,5 +1,5 @@
 ---
-# file: roles/cleanup/tasks/kill_process.yaml
+# file: tasks/kill_process.yaml
 
 - name: Kill Process - {{ process }}
   block:
@@ -14,6 +14,7 @@
     - name: Safe Kill {{ process }}
       ansible.builtin.shell: "kill {{ item }}"
       with_items: "{{ running_processes.stdout_lines }}"
+      ignore_errors: true
       tags:
         - kill-process
 
index eeda013..c97b9c5 100644 (file)
@@ -1,22 +1,5 @@
 ---
-# 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
index 3d8f322..086a4ef 100644 (file)
@@ -1,5 +1,5 @@
 ---
-# file: roles/cleanup/tasks/nomad.yaml
+# file: tasks/nomad.yaml
 
 - name: Host Cleanup
   block:
@@ -8,15 +8,11 @@
     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
index 27a6785..652729b 100644 (file)
@@ -1,7 +1,7 @@
 ---
-# 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'
@@ -18,4 +18,4 @@
   when:
     - ansible_distribution == 'Ubuntu'
   tags:
-    - remove-package
+    - remove-package
\ No newline at end of file
index 8892699..22bf596 100644 (file)
@@ -1,5 +1,5 @@
 ---
-# file: roles/cleanup/tasks/sut.yaml
+# file: tasks/sut.yaml
 
 - name: Host Cleanup
   block:
index fa2d2d2..8c0162d 100644 (file)
@@ -1,5 +1,5 @@
 ---
-# file: roles/cleanup/tasks/tg.yaml
+# file: tasks/tg.yaml
 
 - name: Host Cleanup
   block:
index f617c4d..c97fa0c 100644 (file)
@@ -1,5 +1,5 @@
 ---
-# file: roles/cleanup/tasks/vpp_device.yaml
+# file: tasks/vpp_device.yaml
 
 - name: Host Cleanup
   block: