-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
featureThis issue/PR relates to a feature requestThis issue/PR relates to a feature requesthas_prmodulemodulemodulepluginsplugin (any type)plugin (any type)system
Description
Summary
Hey we are currently using the modul listen_ports_facts:
- name: Gather facts on listening ports
listen_ports_facts:
- name: List TCP ports
debug:
msg: "{{ ansible_facts.tcp_listen }}"
Which gives us for tcp following output:
[{
"address": "::",
"name": "sshd",
"pid": 937,
"port": 22,
"protocol": "tcp",
"stime": "Thu Jun 2 09:49:16 2022",
"user": "root"
}, ...]
It would be cool to include more infos from netstat or ss.
Mainly state, local_address and foreign_address something like:
[{
"local_address": "0.0.0.0", <----
"foreign_address": "0.0.0.0" <----
"pid": "1152",
"port": "52583",
"state": "Bound", <----
"protocol": "tcp",
"stime": "Thu Jun 2 09:49:16 2022",
"user": "root"
"process": "AzureADConnectAuthenticationAgentService", <----
"service": "AzureADConnectAuthenticationAgent", <----
}, ...]
Finally finding process and service would also be a nice bonus (not in the netstat scope).
Hope this is understandable.
Greetings
Issue Type
Feature Idea
Component Name
plugins/modules/system/listen_ports_facts.py
Additional Information
No response
Code of Conduct
- I agree to follow the Ansible Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureThis issue/PR relates to a feature requestThis issue/PR relates to a feature requesthas_prmodulemodulemodulepluginsplugin (any type)plugin (any type)system