zun/roles/fetch_docker_log/tasks/main.yaml
Hongbin Lu 87a0764cfb Fetch docker logs in post run
Change-Id: If025a9d3f8e2708c1bebcb2419dd840b15cab79b
2019-09-02 15:15:32 +00:00

12 lines
374 B
YAML

- name: Ensure {{ ansible_user_dir }}/logs exists
become: True
file:
path: "{{ ansible_user_dir }}/logs"
state: directory
owner: "{{ ansible_user }}"
- name: Copy over docker systemd unit journals
shell:
cmd: |
sudo journalctl -o short-precise --unit docker | sudo tee {{ ansible_user_dir }}/logs/docker.txt > /dev/null
executable: /bin/bash