Can I specify regions with Ansible "serial" param?

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
  # do the deregistration here
  roles:
  - some_role
  - some_other_role
  post_tasks:
  # re-register boxes here.

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?

+4
source share
1 answer

Ansible 1.x . .

Ansible 2.x , strategies , , , , , .

Ansible 1.x , , - . , , .

0

Source: https://habr.com/ru/post/1618361/


All Articles