Created
June 4, 2024 21:11
-
-
Save Pr1meSuspec7/339ed7f2fafbde69aa9ead76d0793729 to your computer and use it in GitHub Desktop.
Ansible loop output in one file
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: Save output | |
ansible.builtin.copy: | |
content: |- | |
{% for host in ansible_play_hosts_all %} | |
{{ '### ' }}{{ host }}{{ ' ###' }} | |
{{ hostvars[host]['result']['stdout_lines'] | to_nice_json }} | |
{% endfor %} | |
dest: output.log | |
mode: "0644" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment