Use stage-output role in system-config-run
This simplifies log collection. Change-Id: I754637115f8c7469efbc1856e88bbcb6fb83b4ce Depends-On: https://review.openstack.org/634293
This commit is contained in:
parent
df6edc372a
commit
22ad414a86
@ -339,6 +339,15 @@
|
|||||||
post-run: playbooks/zuul/run-base-post.yaml
|
post-run: playbooks/zuul/run-base-post.yaml
|
||||||
vars:
|
vars:
|
||||||
install_ansible_ara_enable: true
|
install_ansible_ara_enable: true
|
||||||
|
zuul_copy_output: "{{ copy_output | combine(host_copy_output | default({})) }}"
|
||||||
|
stage_dir: "{{ ansible_user_dir }}/zuul-output"
|
||||||
|
copy_output:
|
||||||
|
'/var/log/syslog': logs_txt
|
||||||
|
'/var/log/messages': logs_txt
|
||||||
|
host-vars:
|
||||||
|
bridge.openstack.org:
|
||||||
|
host_copy_output:
|
||||||
|
'{{ zuul.project.src_dir }}/junit.xml': logs
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: system-config-run-base
|
name: system-config-run-base
|
||||||
|
@ -16,43 +16,8 @@
|
|||||||
|
|
||||||
- hosts: all
|
- hosts: all
|
||||||
tasks:
|
tasks:
|
||||||
- name: Set log directory
|
- include_role:
|
||||||
set_fact:
|
name: stage-output
|
||||||
log_dir: "{{ zuul.executor.log_root }}/hosts/{{ inventory_hostname }}/logs"
|
|
||||||
|
|
||||||
- name: Create list of files to collect
|
|
||||||
set_fact:
|
|
||||||
_to_collect: []
|
|
||||||
|
|
||||||
- name: Check for /var/log/syslog (debuntu)
|
|
||||||
stat:
|
|
||||||
path: '/var/log/syslog'
|
|
||||||
register: _syslog
|
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: Collect syslog
|
|
||||||
set_fact:
|
|
||||||
_to_collect: '{{ _to_collect + [_syslog.stat.path] }}'
|
|
||||||
when: _syslog.stat.exists
|
|
||||||
|
|
||||||
- name: Check for /var/log/messages (rpmish)
|
|
||||||
stat:
|
|
||||||
path: '/var/log/messages'
|
|
||||||
register: _messages
|
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: Collect messages
|
|
||||||
set_fact:
|
|
||||||
_to_collect: '{{ _to_collect + [_messages.stat.path] }}'
|
|
||||||
when: _messages.stat.exists
|
|
||||||
|
|
||||||
- name: 'Collect logs for {{ inventory_hostname }}'
|
|
||||||
synchronize:
|
|
||||||
dest: "{{ log_dir }}/{{ item | basename }}"
|
|
||||||
mode: pull
|
|
||||||
src: "{{ item }}"
|
|
||||||
become: yes
|
|
||||||
loop: "{{ _to_collect }}"
|
|
||||||
|
|
||||||
- hosts: bridge.openstack.org
|
- hosts: bridge.openstack.org
|
||||||
tasks:
|
tasks:
|
||||||
@ -60,19 +25,6 @@
|
|||||||
set_fact:
|
set_fact:
|
||||||
log_dir: "{{ zuul.executor.log_root }}/hosts/{{ inventory_hostname }}"
|
log_dir: "{{ zuul.executor.log_root }}/hosts/{{ inventory_hostname }}"
|
||||||
|
|
||||||
- name: Register junit.xml file
|
|
||||||
stat:
|
|
||||||
path: "{{ zuul.project.src_dir }}/junit.xml"
|
|
||||||
register: _junit
|
|
||||||
|
|
||||||
- name: Collect testinfra logs
|
|
||||||
synchronize:
|
|
||||||
dest: "{{ zuul.executor.log_root }}"
|
|
||||||
mode: pull
|
|
||||||
src: "{{ zuul.project.src_dir }}/junit.xml"
|
|
||||||
verify_host: true
|
|
||||||
when: _junit.stat.exists|bool
|
|
||||||
|
|
||||||
# Because during the test we run ansible as root, we need
|
# Because during the test we run ansible as root, we need
|
||||||
# to allow ourselves permissions to copy the results
|
# to allow ourselves permissions to copy the results
|
||||||
- name: Open ARA results permissions
|
- name: Open ARA results permissions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user