Open Harliff opened 7 months ago
Files identified in the description:
lib/ansible/plugins/inventory
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
I don't know about what you are seeing in your network, i cannot reproduce it, but when using your configuration, this is what i see the plugin executing:
/usr/bin/nmap -p 5986 192.168.88.194
might add this to plugin for easier debugging in future.
diff --git a/plugins/inventory/nmap.py b/plugins/inventory/nmap.py
index 7fa92ae97..91ceed53d 100644
--- a/plugins/inventory/nmap.py
+++ b/plugins/inventory/nmap.py
@@ -240,6 +240,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
cmd.append(self.get_option('address'))
try:
# execute
+ self.display.vvv('Running: %s' % ' '.join(cmd))
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate()
if p.returncode != 0:
!component =plugins/inventory/nmap.py
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
Summary
Nmap inventory plugin send packets to 80 and 443 tcp ports instead of port(s) defined in inventory file.
Issue Type
Bug Report
Component Name
nmap inventory plugin
Ansible Version
Community.general Version
Configuration
OS / Environment
Debian 12.4 $ uname -a
Linux neivro 6.1.0-15-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.66-1 (2023-12-09) x86_64 GNU/Linux
Steps to Reproduce
run nmap against target host to ensure that target port is open:
Create minimal nmap inventory file:
run tcpdump to capture all traffic to the target machine
run ansible:
look at tcpdump output:
As we can expect, ansible-inventory shows no hosts:
Expected Results
expected tcpdump output:
Actual Results
actual tcpdump output:
Code of Conduct