Created
September 2, 2015 15:38
-
-
Save electrofelix/3c2e7c2917b968e928fa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| - hosts: localhost | |
| connection: local | |
| tasks: | |
| - name: setup parallel workers | |
| add_host: | |
| name: task-{{ item }} | |
| groups: parallel | |
| service: "{{ item }}" | |
| always_run: yes | |
| with_items: | |
| - one | |
| - two | |
| - three | |
| - hosts: parallel | |
| connection: local | |
| tasks: | |
| - name: build data | |
| set_fact: var={{ hostvars[item].service }} | |
| delegate_to: localhost | |
| run_once: yes | |
| register: services | |
| with_items: groups['parallel'] | |
| - debug: var=services | |
| delegate_to: localhost | |
| run_once: yes |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
last task produces:
Which I can then use map on to extract ansible_facts.var which is the piece I'm interested in.