Kota Tsuyuzaki 28677c0113 Port gathering logs routine from .functests to post ansible yaml
Change-Id: I5cc87cac7eb2a36b8c86a4807592d3ee64d94780
2019-11-08 14:57:57 +09:00

53 lines
1.4 KiB
YAML

---
- hosts: all
tasks:
- name: Create log directory to pull
file:
path: '{{ zuul.project.src_dir }}/logs'
state: directory
- name: Prepare the logs into user space
shell: "egrep {{ item }} /var/log/syslog > {{ zuul.project.src_dir }}/logs/{{ item }}.log"
with_items:
- "account-server"
- "container-server"
- "object-server"
- "proxy-server"
- "ansible"
- "storlets-daemon"
- "daemon-factory"
become: yes
- name: Change log permisson as readable
file:
path: "{{ zuul.project.src_dir }}/logs/{{ item }}.log"
mode: 0644
with_items:
- "account-server"
- "container-server"
- "object-server"
- "proxy-server"
- "ansible"
- "storlets-daemon"
- "daemon-factory"
become: yes
- name: Copy logs from worker nodes to executor node
synchronize:
# TODO: make it sort of tox_envdir
src: '{{ zuul.project.src_dir }}/logs'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
ignore_errors: yes
- name: Copy conf files from worker nodes to executor node
synchronize:
src: '/etc/swift'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
ignore_errors: yes