sorry, i pasted an older (broken) yml ... https://paste.pound-python.org/show/QAOL5ukLVvAtqtCN8I3V/
the difference is "report.stdout" vs "report.stdout.lines" ... this issue also happens with blockinfile. ----- On Aug 3, 2017, at 3:18 PM, dewey hylton [email protected] wrote: > hi all. i run a python script on a linux server that produces a report > relating > to > patch levels and such. it's a fairly simple thing that was requested for audit > purposes. it's a home-grown script. it works fine, and does what it needs to > do. > the report it produces is simply sent to stdout. > > with the hope of producing a single report covering all of these servers, i > have > created a simple playbook which is designed to run the script on all targets, > capture their report via stdout, and add the reports to a single local file > via > local_action. sometimes this works, and sometimes it does not. in all cases i > can see that the report is generated (stdout for each target shows on the > ansible controller during task execution). but sometimes all output for a > given > target is missing from the local logfile. here is the playbook: > > in case it gets munged in email: > https://paste.pound-python.org/show/Q8hdyPC38ADSYCX82wwV/ > > --- > - hosts: all > > tasks: > - name: run report > script: pkgReport.py {{ inventory_hostname }} > register: report > > - name: build local report > lineinfile: > path: "/tmp/pkgReport.txt" > insertafter: EOF > line: "{{ item }}" > state: present > create: yes > with_items: "{{ report.stdout.lines }}" > delegate_to: 127.0.0.1 > > > so first question ... can someone point out what i may be doing wrong? > and of course next question ... what is the smartest way of doing this? -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1411287664.24443.1501789250932.JavaMail.zimbra%40hyltown.com. For more options, visit https://groups.google.com/d/optout.
