Taking snapshots in ansible using volume ids in AWS

I am keeping all the volume ids in a list and executing the ansible task ec2_snapshot. Here the snapshot calling is happening one at a time. I would like to know how to trigger parallelly the snapshot which are exist in the list(having volumes).

Appreciate your help on this.
  • post-author-pic
    Terrence C

    Check your setting ('serial').  If you are including the setting under your 'hosts' section ('serial: 1'), that will cause Ansible to execute the commands sequentially. Otherwise, Ansible will execute the command in parallel across all hosts (or at least as many as the available resources will allow) in your inventory. Keep in mind that it will do that only a command at a time, meaning that a single play/tasks execute that way, if one host finishes before the others, it will wait until ALL hosts are finished with that task before any host will receive the next task. Keeps things running in a consistent order in case there are dependencies.

Looking For Team Training?

Learn More