fedora-ansible/playbooks/manual/liberate-5099.yml

15 lines
394 B
YAML

# 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 }}"