Commit b8e3151f by ansible

no message

1 parent a2e09478
Showing with 18 additions and 8 deletions
- name: Find All process than open port except SSH
shell: lsof -n -i4TCP |grep -v 'ssh' | grep LISTEN | awk '{ print $2 }'
register: pid
- debug: pidlist=pid.stdout
- name: Kill All found process
shell: kill -9 pidlist
when: pidlist == ""
- name: Get running processes
shell: lsof -n -i4TCP |grep -v 'ssh' | grep LISTEN | awk '{ print $2 }'
register: running_processes
- name: Kill running processes
shell: "kill {{ item }}"
with_items: "{{ running_processes.stdout_lines }}"
- wait_for:
path: "/proc/{{ item }}/status"
state: absent
with_items: "{{ running_processes.stdout_lines }}"
ignore_errors: yes
register: killed_processes
- name: Force kill stuck processes
shell: "kill -9 {{ item }}"
with_items: "{{ killed_processes.results | select('failed') | map(attribute='item') | list }}"
- name: Check & Recreate Stack Folder
file:
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!