Created
March 16, 2014 13:39
-
-
Save kaz-tk/9583384 to your computer and use it in GitHub Desktop.
ansibleで、/var/log/を全部取ってくるやつ。
This file contains hidden or 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
--- | |
- hosts: webservers | |
user: miyabi | |
sudo: True | |
tasks: | |
- name: backupdate | |
command: date +"%Y%m%d%H%M%S" | |
register: execdate | |
- name: list /var/log/ | |
command: find /var/log/ -type f | |
register: logfiles | |
- name: Fetch All Log | |
fetch: src={{item}} dest={{ execdate }} | |
with_items: ${logfiles.stdout_lines} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment