From a47f22d60863aed4bd640373a1ce96364de521a7 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Mon, 2 Sep 2019 22:44:21 +0200 Subject: [PATCH] Set path for tobiko logs in devstack tobiko jobs Tobiko should now log its output to '{{ ansible_user_dir }}' directory thus it will be fetched by Zuul after job ends and we will be able to check tobiko logs after every CI job run in Zuul. Change-Id: I2f6e0edd2878e5a7ffd9697a3eaeea61a4c03674 --- playbooks/pre-tobiko-devstack.yaml | 3 +++ roles/setup_tobiko_logs_dir/README.rst | 8 ++++++++ roles/setup_tobiko_logs_dir/defaults/main.yml | 1 + roles/setup_tobiko_logs_dir/tasks/main.yml | 8 ++++++++ zuul.d/tobiko-devstack.yaml | 5 ++--- 5 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 roles/setup_tobiko_logs_dir/README.rst create mode 100644 roles/setup_tobiko_logs_dir/defaults/main.yml create mode 100644 roles/setup_tobiko_logs_dir/tasks/main.yml diff --git a/playbooks/pre-tobiko-devstack.yaml b/playbooks/pre-tobiko-devstack.yaml index 85997798e..f5caa847a 100644 --- a/playbooks/pre-tobiko-devstack.yaml +++ b/playbooks/pre-tobiko-devstack.yaml @@ -27,3 +27,6 @@ owner: stack group: stack become: yes + + roles: + - setup_tobiko_logs_dir diff --git a/roles/setup_tobiko_logs_dir/README.rst b/roles/setup_tobiko_logs_dir/README.rst new file mode 100644 index 000000000..eac635325 --- /dev/null +++ b/roles/setup_tobiko_logs_dir/README.rst @@ -0,0 +1,8 @@ +Configure tobiko logs directory to be accessible for ``stack`` user. + +**Role Variables** + +.. zuul:rolevar:: tobiko_logsdir + :default: /opt/stack/tobiko_logs + + Name of the directory where Tobiko configs will be stored. diff --git a/roles/setup_tobiko_logs_dir/defaults/main.yml b/roles/setup_tobiko_logs_dir/defaults/main.yml new file mode 100644 index 000000000..e451d7700 --- /dev/null +++ b/roles/setup_tobiko_logs_dir/defaults/main.yml @@ -0,0 +1 @@ +tobiko_logsdir: "/opt/stack/tobiko_logs" diff --git a/roles/setup_tobiko_logs_dir/tasks/main.yml b/roles/setup_tobiko_logs_dir/tasks/main.yml new file mode 100644 index 000000000..5d99abe0b --- /dev/null +++ b/roles/setup_tobiko_logs_dir/tasks/main.yml @@ -0,0 +1,8 @@ +- name: Ensure logdir exists + become: yes + file: + path: "{{ tobiko_logsdir }}" + state: directory + owner: stack + group: "{{ ansible_user }}" + mode: 0775 diff --git a/zuul.d/tobiko-devstack.yaml b/zuul.d/tobiko-devstack.yaml index 8bba52d9d..9542340d8 100644 --- a/zuul.d/tobiko-devstack.yaml +++ b/zuul.d/tobiko-devstack.yaml @@ -24,6 +24,7 @@ # TOBIKO_KEYSTONE_USERNAME: tobiko # TOBIKO_KEYSTONE_PASSWORD: secret_tobiko # TOBIKO_KEYSTONE_PROJECT_NAME: tobiko + TOBIKO_LOG_DIR: '{{ devstack_base_dir }}/tobiko_logs' devstack_plugins: heat: https://opendev.org/openstack/heat.git neutron: https://opendev.org/openstack/neutron.git @@ -70,9 +71,7 @@ min_compute_nodes: "{{ groups['compute'] | default(['controller']) | length }}" test_results_stage_name: test_results zuul_copy_output: - '{{ devstack_base_dir }}/tobiko/etc/tobiko.conf': logs - '{{ devstack_base_dir }}/tobiko/etc/accounts.yaml': logs - '{{ devstack_base_dir }}/tobiko/tobiko.log': logs + '{{ devstack_base_dir }}/tobiko_logs': logs '{{ stage_dir }}/{{ test_results_stage_name }}.subunit': logs '{{ stage_dir }}/{{ test_results_stage_name }}.html': logs '{{ stage_dir }}/stackviz': logs