Browse Source

Use new log collection process

While this isn't 100%, it is enough to actually get started using it.

Change-Id: I8e4bad97658f98ca5280eca694dc2d9cb4028ad1
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
changes/14/584614/19
Paul Belanger 11 months ago
parent
commit
81b000901c
3 changed files with 25 additions and 5 deletions
  1. 1
    0
      .zuul.yaml
  2. 18
    4
      tests/collect-logs.yaml
  3. 6
    1
      tests/playbooks/pre.yaml

+ 1
- 0
.zuul.yaml View File

@@ -5,6 +5,7 @@
5 5
     post-run: tests/collect-logs.yaml
6 6
     roles:
7 7
       - zuul: openstack/ansible-role-nodepool
8
+      - zuul: openstack/zuul-jobs
8 9
 
9 10
 # Testing for nodepool_install_method: pip
10 11
 - job:

+ 18
- 4
tests/collect-logs.yaml View File

@@ -1,10 +1,24 @@
1 1
 - hosts: all
2 2
   tasks:
3
-    - name: Collect nodepool log files
3
+    - name: Prepare nodepool log files
4
+      become: yes
4 5
       synchronize:
5
-        dest: "{{ zuul.executor.log_root }}/logs"
6
-        mode: pull
6
+        dest: "{{ zuul_output_dir }}/logs/logs"
7 7
         rsync_opts:
8 8
           - "--relative"
9
-        src: /var/log/nodepool
9
+          - "--chown={{ ansible_user_id }}:{{ ansible_user_id }}"
10
+        src: "{{ item }}"
11
+        verify_host: true
12
+      delegate_to: "{{ inventory_hostname }}"
13
+      with_items:
14
+        - /etc/nodepool
15
+        - /var/log/nodepool
16
+
17
+    # TODO: Migrate to fetch-zuul-logs when
18
+    # https://review.openstack.org/#/c/583346/ is merged.
19
+    - name: Collect log output
20
+      synchronize:
21
+        dest: "{{ zuul.executor.log_root }}/"
22
+        mode: pull
23
+        src: "{{ zuul_output_dir }}/logs/"
10 24
         verify_host: true

+ 6
- 1
tests/playbooks/pre.yaml View File

@@ -1,9 +1,14 @@
1 1
 - hosts: all
2 2
   tasks:
3
+    # TODO(pabelanger): Remove once this lands in our base job in
4
+    # project-config.
5
+    - name: Execute ensure-output-dirs role
6
+      include_role:
7
+        name: ensure-output-dirs
8
+
3 9
     - name: Disable extra wheels mirror
4 10
       become: yes
5 11
       lineinfile:
6 12
         dest: /etc/pip.conf
7 13
         regexp: ^extra-index-url
8 14
         state: absent
9
-

Loading…
Cancel
Save