---
- hosts: ds1:ds2:ds3
remote_user: root
vars:
outfile: /tmp/test.out
tasks:
- name: test | start with empty local file
local_action: file path={{ outfile }} state=absent
run_once: true
- name: test | generate output one line per host
shell: "echo {{ ansible_hostname }} file.sh dbname"
register: hostout
- debug: var=hostout.stdout
- name: test | create local file listing all output from above
local_action: lineinfile dest={{ outfile }} line="{{ hostout.stdout }}" create=yes
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0267337b-1501-4f2f-994c-21aa43eecc00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.