Created
March 23, 2018 13:27
-
-
Save prandelicious/27f83918745609731a20b00376dd44ba to your computer and use it in GitHub Desktop.
[Ansible] Write output of several hosts into a single list/display
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: mygroup | |
gather_facts: false | |
tasks: | |
- shell: date | |
register: date_res | |
changed_when: false | |
- debug: | |
msg: "{{ ansible_play_hosts | map('extract', hostvars, 'date_res') | map(attribute='stdout') | list }}" | |
run_once: yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment