I have the following playbook but have 2 problems:

   1.  The contents of the file are garbled.  Why is that?  How can I clear 
   it up?
   2.  How can I just grab the contents of the file only?  
   {{file_contents.results.content}} complains

---
- hosts: "{{ host }}"
  tasks:
    - name: Fetch files from remote server
      slurp:
        src: "{{item.src}}"
      with_items:
        - {src: "/etc/security/limits.conf"}
        - {src: "/etc/sysctl.conf"}
        - {src: "/boot/grub/grub.conf"}
      register: file_contents

#    - name: DEBUG
#      debug:
#        var: file_contents

    - name: Write results
      lineinfile:
        dest: "/tmp/hugepages_results.txt"
        line: "HOST: {{ansible_nodename}} \n{{file_contents.results}}\n"
        insertafter: EOF
        create: yes
        state: present
      delegate_to: localhost



-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/523126be-72a5-4792-bd14-78db977c321b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to