Skip to content

Instantly share code, notes, and snippets.

@mohsen0
Last active May 3, 2019 17:00
Show Gist options
  • Save mohsen0/6154338a03d510c29160dee21439e3d9 to your computer and use it in GitHub Desktop.
Save mohsen0/6154338a03d510c29160dee21439e3d9 to your computer and use it in GitHub Desktop.
Ansible playbook to download /var/log

Ansible playbook to download /var/log

- name: Fetch /var/log
  hosts: all
  become: yes
  gather_facts: false
  tasks:
      - name: Find /var/log
        find:
          paths: /var/log
          recurse: yes
        register: log_files
      - fetch:
          src: "{{item.path}}"
          dest: "logs/"
        loop: "{{ log_files.files }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment