NMAP in Ansible

Hi,

Anyone is aware as to how to use nmap plugin to populate inventory dynamically from local premises ?

Manish

The plugin itself has an example config, you might just need to change
the IP ranges involved.

https://docs.ansible.com/ansible/latest/collections/community/general/nmap_inventory.html#examples

Thanks for the reply.
Yes I am aware but I am used to INI format and the example is in YAML format. Is it possible to convert the same to INI format.
Below is the example of my inventory which is static
[centos]

[ubuntu]

& so on…

If I have to execute in ansible, the command I use is — >ansible centos -m ping ---- & so on
Can you guide me how to do it for nmap ? Please advise!

Manish

no, it uses a yaml configuration file to generate a dynamic inventory,
which is not the same as an ini inventory file (static)

So can you guide me as to how use those nmap configuration in .YAML file and then how to execute ansible i.e. which command to use ansible or ansible-playbook… Please help!

Manish