This Perl script discovers the hosts in a subnet using nmap, and creates an ansible inventory for them. This can be useful in the case of an autoscaling farm of AWS EC2 or Aliyun ECS instances.
You can modify the name of the output file, and you need to modify the subnetworks to be scanned, by using the --networks and --file parameters:
perl discover.pl --networks="192.168.0.0/24 10.0.1.0/24" --file=farm.yaml
Copyright (c) 2023 Rodolfo González González.
Read the LICENSE file.