Files
community.general/plugins/inventory
RealCharlesChia 18a8791ece Fix nmap inventory plugin: skip setting reserved 'name' variable (#11893)
* Fix nmap inventory plugin: skip setting reserved 'name' variable

Skip setting 'name' as a host variable to avoid Ansible warning:
'[WARNING]: Found variable using reserved name name'

The 'name' is already used as the hostname, so it's redundant as a
separate host variable. This fixes the warning that appears when using
the nmap inventory plugin.

Fixes: https://github.com/ansible-collections/community.general/issues/11766

* nmap inventory plugin: add set_name_variable option to control name variable
Add a new 'set_name_variable' option to control whether the 'name' variable
is set for each host. When true (default), maintains backward compatibility.
When false, skips setting the 'name' variable to avoid the 'Found variable
using reserved name' warning.
Fixes: https://github.com/ansible-collections/community.general/issues/11766

* Address review feedback: fix changelog category and version number

- Change 'bugfixes' to 'minor_changes' in changelog fragment
- Add PR and issue links to changelog description
- Update version_added from 10.6.0 to 13.0.0

Reviewed-by: felixfontein

---------

Co-authored-by: jiaza <jiaza@nscc-tj.cn>
2026-04-25 21:07:19 +02:00
..