Ansible works against multiple servers in your infrastructure at the same time.
Different inventory file using the -i <path> option on the command line.
$ ansible-playbook -i inventory playbook.yaml --key-file=remote.pem -u ec2-user
Multiple inventory files can be provided using folder for AWS
$ wget https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/ec2.py
$ ansible -i ec2.py playbook.yaml --key-file=remote.pem -u ec2-user
Multiple inventory files can be provided using folder for OpenStake
$ wget https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/openstack_inventory.py
$ chmod +x openstack_inventory.py
$ ansible -i openstack_inventory.py playbook.yaml --key-file=remote.pem -u ec2-user
Content of file "inventory"
192.168.33.20
192.168.33.30
hostname1
hostname2