50 lines
1.6 KiB
YAML
50 lines
1.6 KiB
YAML
---
|
|
- become: true
|
|
ignore_errors: true
|
|
block:
|
|
- name: check if ODL is enabled via docker
|
|
shell: docker ps | grep opendaylight_api
|
|
register: odl_container_enabled
|
|
|
|
- name: check if ODL is enabled via podman
|
|
shell: podman ps | grep opendaylight_api
|
|
register: odl_container_enabled
|
|
when: odl_container_enabled.rc != 0
|
|
|
|
|
|
- name: check if ODL is enabled via rpm # noqa: command-instead-of-module
|
|
shell: rpm -qa | grep opendaylight
|
|
register: odl_rpm_enabled
|
|
|
|
- name: Create ODL log directory
|
|
file:
|
|
dest: "{{ odl_extra_log_dir }}"
|
|
state: directory
|
|
mode: 0755
|
|
when: (odl_rpm_enabled.rc == 0) or (odl_container_enabled.rc == 0)
|
|
|
|
- name: Collect OVS outputs for ODL
|
|
shell: "bash /tmp/odl_extra_logs.sh" # noqa 305
|
|
when: (odl_rpm_enabled.rc == 0) or (odl_container_enabled.rc == 0)
|
|
|
|
- name: Collect ODL info and logs (RPM deployment)
|
|
shell: >
|
|
cp /opt/opendaylight/data/log/* /var/log/extra/odl/;
|
|
journalctl -u opendaylight > /var/log/extra/odl/odl_journal.log
|
|
when: odl_rpm_enabled.rc == 0
|
|
|
|
- name: Copy collection logs script for containers
|
|
copy:
|
|
src: collect-container-logs.sh
|
|
dest: /tmp/collect-container-logs.sh
|
|
mode: 0755
|
|
|
|
- name: Run container logs collection with timeout
|
|
command: >-
|
|
timeout --preserve-status -s 15 -k {{ (artcl_container_collect_timeout|int + 30)|string }}
|
|
{{ artcl_container_collect_timeout|string }} bash -x /tmp/collect-container-logs.sh
|
|
changed_when: true
|
|
async: 600
|
|
poll: 0
|
|
register: container_collection
|