From 1b6248977955d0a8425509e9c7d632dd1bb00561 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Tue, 29 May 2018 14:36:52 +0200 Subject: [PATCH] ceph-ansible: fix teardown issue MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit At the moment, the teardown isn't fully executed because of `collect-logs.yml` playbook. it is expected the following task can fail according to the context of the main failure: ``` TASK [find ceph logs] ********************************************************** task path: /home/jenkins-build/build/workspace/ceph-ansible-scenario/collect-logs.yml:4 fatal: [ceph-nfs0]: FAILED! => { "changed": true, "cmd": [ "find", "/var/log/ceph", "-name", "test*.log" ], "delta": "0:00:00.003363", "end": "2018-05-23 16:45:22.845782", "rc": 1, "start": "2018-05-23 16:45:22.842419" } STDERR: find: ‘/var/log/ceph’: No such file or directory MSG: non-zero return code ``` therefore, `teardown_vagrant_tests()` doesn't return `0` and causes the teardown to stop because of `set -e` ``` PLAY RECAP ********************************************************************* ceph-client0 : ok=1 changed=0 unreachable=0 failed=1 ceph-client1 : ok=1 changed=0 unreachable=0 failed=1 ceph-iscsi-gw0 : ok=1 changed=0 unreachable=0 failed=1 ceph-mds0 : ok=1 changed=0 unreachable=0 failed=1 ceph-mgr0 : ok=1 changed=0 unreachable=0 failed=1 ceph-mon0 : ok=3 changed=2 unreachable=0 failed=0 ceph-mon1 : ok=3 changed=2 unreachable=0 failed=0 ceph-mon2 : ok=3 changed=2 unreachable=0 failed=0 ceph-nfs0 : ok=1 changed=0 unreachable=0 failed=1 ceph-osd0 : ok=1 changed=0 unreachable=0 failed=1 ceph-rbd-mirror0 : ok=1 changed=0 unreachable=0 failed=1 ceph-rgw0 : ok=1 changed=0 unreachable=0 failed=1 Build step 'Execute Scripts' marked build as failure Archiving artifacts Finished: FAILURE ``` adding a `failed_when: false` on this task should avoid this bug. Signed-off-by: Guillaume Abrioux --- scripts/build_utils.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index d099082b..60fc25c4 100644 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -716,6 +716,7 @@ write_collect_logs_playbook() { - name: find ceph logs command: find /var/log/ceph -name "{{ cluster|default('ceph') }}*.log" register: ceph_logs + failed_when: false - name: collect ceph logs fetch: -- 2.47.3