I am preparing to write an Ansible playbook that will deploy an Elasticsearch cluster with docker containers (and later use this same technique for other things).
My goal is to supply a number (an integer), and with this number Ansible will generate a list of hosts and other parameters it needs for the deployment.
for example, if I supply a number like 3, then Ansible will deploy the named containers:
elastic-1elastic-2elastic-3
on hosts:
host-1host-2host-3
I found this article that seems to fit my needs: https://docs.ansible.com/ansible/2.10/collections/ansible/builtin/generator_inventory.html but I can't figure out how to use an integer like I described.