Created
July 13, 2023 15:07
-
-
Save felher/8ebb955ac6a630ea5e694ae99b2fec62 to your computer and use it in GitHub Desktop.
ansible parallelism
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Tests | |
hosts: study_hosts | |
gather_facts: false | |
become: false | |
tasks: | |
- name: A | |
ansible.builtin.command: sleep 1 | |
loop: "{{ [1, 2] }}" | |
# Runs: | |
# 1s: wait on host 1 && wait on host 2 | |
# 2s: wait on host 1 && wait on host 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Tests | |
hosts: study_hosts | |
gather_facts: false | |
become: false | |
tasks: | |
- name: A | |
ansible.builtin.command: sleep 1 | |
loop: "{{ [inventory_hostname, inventory_hostname] }}" | |
# Runs: | |
# 1s: wait on host 1 && wait on host 2 | |
# 2s: wait on host 1 && wait on host 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Tests | |
hosts: study_hosts | |
gather_facts: false | |
become: false | |
tasks: | |
- name: A | |
ansible.builtin.include_role: | |
name: "test" | |
loop: "{{ [1, 2] }}" | |
# Runs: | |
# 1s: wait on host 1 && wait on host 2 | |
# 2s: wait on host 1 && wait on host 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Tests | |
hosts: study_hosts | |
gather_facts: false | |
become: false | |
tasks: | |
- name: A | |
ansible.builtin.include_role: | |
name: "test" | |
loop: "{{ [inventory_hostname, inventory_hostname] }}" | |
# Runs: | |
# 1s: wait on host 1 | |
# 2s: wait on host 1 | |
# 3s: wait on host 2 | |
# 4s: wait on host 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Wait | |
ansible.builtin.command: sleep 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment