diff options
Diffstat (limited to 'fdio.infra.ansible/roles/cleanup/tasks/kill_process.yaml')
-rw-r--r-- | fdio.infra.ansible/roles/cleanup/tasks/kill_process.yaml | 6 |
1 files changed, 3 insertions, 3 deletions
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 |