Playbook to free up port 5099 when it gets stuck.

This commit is contained in:
Ralph Bean 2014-05-01 20:24:37 +00:00
parent 22b56a5341
commit 5ea889e578

View file

@ -0,0 +1,14 @@
# requires --extra-vars="target='host1;host2;group etc'
- name: Find whatever is running on port 5099 and storm its figurative bastille.
hosts: "{{ target }}"
user: root
tasks:
- name: find the PID of whatever is on port 5099
command: lsof -i :5099 -t
register: offenders
- name: salt the earth
command: "kill {{ item }}"
with_items: "{{ offenders.stdout_lines }}"