I am running a server deployment in ec2 through Ansible. I start deployment on several servers at a time using a parameter serial, for example:
- name: run update
hosts: tag_app_servers:&tag_active_servers
serial: 7
sudo: True
pre_tasks:
- name: Gathering ec2 facts
action: ec2_facts
roles:
- some_role
- some_other_role
post_tasks:
Thing is, Ansible believes that all my servers are the same (as it should be) and do not distinguish between servers in different regions. Therefore, although I would like it to take one server from each of the 7 regions I was in and run updates on parallel servers, Ansible can instead take 7 servers from only one region and completely cripple it. This is not a huge problem, because traffic is simply redirected to other regions, but it is far from ideal. What would be a good way to get it to capture servers from different regions when running multiple server updates in parallel?
source
share