diff options
Diffstat (limited to 'fdio.infra.ansible/roles/cleanup/tasks')
6 files changed, 17 insertions, 17 deletions
diff --git a/fdio.infra.ansible/roles/cleanup/tasks/clean_images.yaml b/fdio.infra.ansible/roles/cleanup/tasks/clean_images.yaml index 7558ee0fd7..f3778712bf 100644 --- a/fdio.infra.ansible/roles/cleanup/tasks/clean_images.yaml +++ b/fdio.infra.ansible/roles/cleanup/tasks/clean_images.yaml @@ -4,7 +4,7 @@ - name: Clean Docker Images block: - name: Clean Images - Prefetch Docker Images - cron: + ansible.builtin.cron: name: "Prefetch docker image {{ item }}" minute: "10" hour: "7" @@ -15,7 +15,7 @@ - prefetch-docker-images - name: Clean Images - Remove Dangling Docker Images - cron: + ansible.builtin.cron: name: "Remove dangling docker images" minute: "10" hour: "5" diff --git a/fdio.infra.ansible/roles/cleanup/tasks/kill_containers.yaml b/fdio.infra.ansible/roles/cleanup/tasks/kill_containers.yaml index 750572feb9..2c01b95a15 100644 --- a/fdio.infra.ansible/roles/cleanup/tasks/kill_containers.yaml +++ b/fdio.infra.ansible/roles/cleanup/tasks/kill_containers.yaml @@ -4,35 +4,35 @@ - name: Kill Docker Containers block: - name: Kill Container - Get Running Docker Containers - shell: "docker ps -aq" + ansible.builtin.shell: "docker ps -aq" register: running_containers changed_when: false tags: - kill-containers - name: Kill Container - Remove All Docker Containers - shell: "docker rm --force {{ item }}" + ansible.builtin.shell: "docker rm --force {{ item }}" with_items: "{{ running_containers.stdout_lines }}" tags: - kill-containers rescue: - name: Restart Docker Daemon - systemd: + ansible.builtin.systemd: name: "docker" state: "restarted" - name: Kill LXC Containers block: - name: Kill Container - Get Running LXC Containers - shell: "lxc-ls" + ansible.builtin.shell: "lxc-ls" register: running_containers changed_when: false tags: - kill-containers - name: Kill Container - Remove All LXC Containers - shell: "lxc-destroy --force -n {{ item }}" + ansible.builtin.shell: "lxc-destroy --force -n {{ item }}" with_items: "{{ running_containers.stdout_lines }}" tags: - kill-containers diff --git a/fdio.infra.ansible/roles/cleanup/tasks/kill_process.yaml b/fdio.infra.ansible/roles/cleanup/tasks/kill_process.yaml index d6c6ed5118..bad5ef5e7c 100644 --- a/fdio.infra.ansible/roles/cleanup/tasks/kill_process.yaml +++ b/fdio.infra.ansible/roles/cleanup/tasks/kill_process.yaml @@ -4,7 +4,7 @@ - name: Kill Process - {{ process }} block: - name: Get PID Of {{ process }} - shell: "ps -ef | grep -v grep | grep -w {{ process }} | awk '{print $2}'" + ansible.builtin.shell: "ps -ef | grep -v grep | grep -w {{ process }} | awk '{print $2}'" when: - process is defined and process != "" register: running_processes @@ -12,7 +12,7 @@ - kill-process - name: Safe Kill {{ process }} - shell: "kill {{ item }}" + ansible.builtin.shell: "kill {{ item }}" with_items: "{{ running_processes.stdout_lines }}" tags: - kill-process @@ -27,7 +27,7 @@ - kill-process - name: Kill Process - Force Kill {{ process }} - shell: "kill -9 {{ item }}" + ansible.builtin.shell: "kill -9 {{ item }}" with_items: "{{ killed_processes.results | select('failed') | map(attribute='item') | list }}" tags: - kill-process diff --git a/fdio.infra.ansible/roles/cleanup/tasks/remove_package.yaml b/fdio.infra.ansible/roles/cleanup/tasks/remove_package.yaml index 484868e595..27a6785440 100644 --- a/fdio.infra.ansible/roles/cleanup/tasks/remove_package.yaml +++ b/fdio.infra.ansible/roles/cleanup/tasks/remove_package.yaml @@ -2,14 +2,14 @@ # file: roles/cleanup/tasks/remove_package.yaml - name: Remove Package - Fix Corrupted APT - shell: "dpkg --configure -a" + ansible.builtin.shell: "dpkg --configure -a" when: - ansible_distribution == 'Ubuntu' tags: - remove-package - name: Remove Package - {{ package }} - apt: + ansible.builtin.apt: name: "{{ package }}" force: true purge: true diff --git a/fdio.infra.ansible/roles/cleanup/tasks/sut.yaml b/fdio.infra.ansible/roles/cleanup/tasks/sut.yaml index 396e442b4e..5524277f52 100644 --- a/fdio.infra.ansible/roles/cleanup/tasks/sut.yaml +++ b/fdio.infra.ansible/roles/cleanup/tasks/sut.yaml @@ -46,7 +46,7 @@ - kill-process - name: Find File Or Dir - Core Zip File - find: + ansible.builtin.find: paths: "/tmp/" patterns: "*tar.lzo.lrz.xz*" register: files_to_delete @@ -54,7 +54,7 @@ - remove-file-dir - name: Remove File Or Dir - Core Zip File - file: + ansible.builtin.file: path: "{{ item.path }}" state: absent with_items: "{{ files_to_delete.files }}" @@ -62,7 +62,7 @@ - remove-file-dir - name: Find File Or Dir - Core Dump File - find: + ansible.builtin.find: paths: "/tmp/" patterns: "*core*" register: files_to_delete @@ -70,7 +70,7 @@ - remove-file-dir - name: Remove File Or Dir - Core Dump File - file: + ansible.builtin.file: path: "{{ item.path }}" state: absent with_items: "{{ files_to_delete.files }}" diff --git a/fdio.infra.ansible/roles/cleanup/tasks/vpp_device.yaml b/fdio.infra.ansible/roles/cleanup/tasks/vpp_device.yaml index 23d001fe6f..f617c4dff5 100644 --- a/fdio.infra.ansible/roles/cleanup/tasks/vpp_device.yaml +++ b/fdio.infra.ansible/roles/cleanup/tasks/vpp_device.yaml @@ -4,7 +4,7 @@ - name: Host Cleanup block: - name: Reset vpp_device Binary - copy: + ansible.builtin.copy: src: "files/reset_vppdevice.sh" dest: "/usr/local/bin" owner: "root" |