aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/cleanup/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/cleanup/tasks')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/cleanup/tasks/kill_containers.yaml38
-rw-r--r--resources/tools/testbed-setup/ansible/roles/cleanup/tasks/kill_process.yaml33
-rw-r--r--resources/tools/testbed-setup/ansible/roles/cleanup/tasks/main.yaml31
-rw-r--r--resources/tools/testbed-setup/ansible/roles/cleanup/tasks/remove_package.yaml19
-rw-r--r--resources/tools/testbed-setup/ansible/roles/cleanup/tasks/sut.yaml72
-rw-r--r--resources/tools/testbed-setup/ansible/roles/cleanup/tasks/tg.yaml9
-rw-r--r--resources/tools/testbed-setup/ansible/roles/cleanup/tasks/vpp_device.yaml15
7 files changed, 0 insertions, 217 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/kill_containers.yaml b/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/kill_containers.yaml
deleted file mode 100644
index ad4fb37681..0000000000
--- a/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/kill_containers.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
----
-# file: roles/cleanup/tasks/kill_containers.yaml
-
-- name: Kill Docker Containers
- block:
- - name: Kill container - Get Running Docker Containers
- shell: "docker ps -aq"
- register: running_containers
- changed_when: no
- tags: kill-containers
-
- - name: Kill container - Remove All Docker Containers
- shell: "docker rm --force {{ item }}"
- with_items: "{{ running_containers.stdout_lines }}"
- tags: kill-containers
-
- rescue:
- - name: Restart Docker Daemon
- systemd:
- name: "docker"
- state: "restarted"
-
-- name: Kill LXC Containers
- block:
- - name: Kill container - Get Running LXC Containers
- shell: "lxc-ls"
- register: running_containers
- changed_when: no
- tags: kill-containers
-
- - name: Kill container - Remove All LXC Containers
- shell: "lxc-destroy --force -n {{ item }}"
- with_items: "{{ running_containers.stdout_lines }}"
- tags: kill-containers
-
- rescue:
- - fail:
- msg: "Kill LXC containers failed!" \ No newline at end of file
diff --git a/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/kill_process.yaml b/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/kill_process.yaml
deleted file mode 100644
index 30a9f459b5..0000000000
--- a/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/kill_process.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
----
-# file: roles/cleanup/tasks/kill_process.yaml
-
-- name: Kill process - {{ process }}
- block:
- - name: Kill process - Get pid of {{ process }}
- shell: "ps -ef | grep -v grep | grep -w {{ process }} | awk '{print $2}'"
- when: >
- process is defined and process != ""
- register: running_processes
- tags: kill-process
-
- - name: Kill process - Safe kill {{ process }}
- shell: "kill {{ item }}"
- with_items: "{{ running_processes.stdout_lines }}"
- tags: kill-process
-
- - wait_for:
- path: "/proc/{{ item }}/status"
- state: absent
- with_items: "{{ running_processes.stdout_lines }}"
- ignore_errors: yes
- register: killed_processes
- tags: kill-process
-
- - name: Kill process - Force kill {{ process }}
- shell: "kill -9 {{ item }}"
- with_items: "{{ killed_processes.results | select('failed') | map(attribute='item') | list }}"
- tags: kill-process
-
- rescue:
- - fail:
- msg: "Kill process {{ process }} failed!"
diff --git a/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/main.yaml
deleted file mode 100644
index 64a55c4672..0000000000
--- a/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/main.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
----
-# 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
-
-- name: tg specific
- include_tasks: tg.yaml
- when: "'tg' in group_names"
- tags: cleanup
-
-- name: sut specific
- include_tasks: sut.yaml
- when: "'sut' in group_names"
- tags: cleanup
-
-- name: vpp_device specific
- include_tasks: vpp_device.yaml
- when: "'vpp_device' in group_names"
- tags: cleanup
diff --git a/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/remove_package.yaml b/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/remove_package.yaml
deleted file mode 100644
index 0c8816fe29..0000000000
--- a/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/remove_package.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
----
-# file: roles/cleanup/tasks/remove_package.yaml
-
-- name: Remove package - Fix corrupted apt
- shell: 'dpkg --configure -a'
- when: >
- ansible_distribution == 'Ubuntu'
- tags: remove-package
-
-- name: Remove package - {{ package }}
- apt:
- name: '{{ package }}'
- force: yes
- purge: yes
- state: absent
- failed_when: no
- when: >
- ansible_distribution == 'Ubuntu'
- tags: remove-package
diff --git a/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/sut.yaml b/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/sut.yaml
deleted file mode 100644
index 53a65dd608..0000000000
--- a/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/sut.yaml
+++ /dev/null
@@ -1,72 +0,0 @@
----
-# file: roles/cleanup/tasks/sut.yaml
-
-- name: Host cleanup
- block:
- - name: Kill processes - qemu
- import_tasks: kill_process.yaml
- vars:
- process: "qemu"
- tags: kill-process
-
- - name: Kill processes - l3fwd
- import_tasks: kill_process.yaml
- vars:
- process: "l3fwd"
- tags: kill-process
-
- - name: Kill processes - testpmd
- import_tasks: kill_process.yaml
- vars:
- process: "testpmd"
- tags: kill-process
-
- - name: Kill processes - iperf3
- import_tasks: kill_process.yaml
- vars:
- process: "iperf3"
- tags: kill-process
-
- - name: Kill processes - vpp_echo
- import_tasks: kill_process.yaml
- vars:
- process: "vpp_echo"
- tags: kill-process
-
- - name: Find file or dir - Core zip file
- find:
- paths: "/tmp/"
- patterns: "*tar.lzo.lrz.xz*"
- register: files_to_delete
- tags: remove-file-dir
-
- - name: Remove file or dir - Core zip file
- file:
- path: "{{ item.path }}"
- state: absent
- with_items: "{{ files_to_delete.files }}"
- tags: remove-file-dir
-
- - name: Find file or dir - Core dump file
- find:
- paths: "/tmp/"
- patterns: "*core*"
- register: files_to_delete
- tags: remove-file-dir
-
- - name: Remove file or dir - Core dump file
- file:
- path: "{{ item.path }}"
- state: absent
- with_items: "{{ files_to_delete.files }}"
- tags: remove-file-dir
-
- - name: Kill containers - Remove all containers
- import_tasks: kill_containers.yaml
- tags: kill-containers
-
- - name: Remove packages - Remove VPP
- import_tasks: remove_package.yaml
- vars:
- package: "*vpp*"
- tags: remove-package
diff --git a/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/tg.yaml b/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/tg.yaml
deleted file mode 100644
index 9ac83bc9fc..0000000000
--- a/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/tg.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
----
-# file: roles/cleanup/tasks/tg.yaml
-
-- name: Kill processes - TRex
- import_tasks: kill_process.yaml
- vars:
- process: "_t-rex"
- when: docker_tg is undefined
- tags: kill-process
diff --git a/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/vpp_device.yaml b/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/vpp_device.yaml
deleted file mode 100644
index f5e6ea5488..0000000000
--- a/resources/tools/testbed-setup/ansible/roles/cleanup/tasks/vpp_device.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
----
-# file: roles/cleanup/tasks/vpp_device.yaml
-
-- name: Reset vpp_device binary
- copy:
- src: 'files/reset_vppdevice.sh'
- dest: '/usr/local/bin'
- owner: 'root'
- group: 'root'
- mode: '744'
- tags: reset-sriov
-
-- name: Reset vpp_device
- raw: 'reset_vppdevice.sh --force'
- tags: reset-sriov