From a9f6ab15e36eb1eb191cc52e06f45b69591e679a Mon Sep 17 00:00:00 2001 From: vass Date: Mon, 6 Apr 2020 20:24:22 +0200 Subject: [PATCH] Remove ssh key in base cleanup run. If the builds ssh key is removed during post run no cleanup actions can be made on remote hosts by jobs inheriting from the base job. It also causes problems with ssh keys not being removed for static nodes when jobs are aborted. Change-Id: Id751e8a842ed0d03e605dcd0620c388c3d7f973b --- playbooks/base/cleanup.yaml | 3 +++ playbooks/base/post.yaml | 7 ------- zuul.yaml | 1 + 3 files changed, 4 insertions(+), 7 deletions(-) create mode 100644 playbooks/base/cleanup.yaml diff --git a/playbooks/base/cleanup.yaml b/playbooks/base/cleanup.yaml new file mode 100644 index 0000000..d793838 --- /dev/null +++ b/playbooks/base/cleanup.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - remove-build-sshkey diff --git a/playbooks/base/post.yaml b/playbooks/base/post.yaml index 0318870..c810eab 100644 --- a/playbooks/base/post.yaml +++ b/playbooks/base/post.yaml @@ -1,10 +1,3 @@ - hosts: all roles: - fetch-output - -- hosts: all - # NOTE(pabelanger): We ignore_errors for the following tasks as not to fail - # successful jobs. - ignore_errors: yes - roles: - - remove-build-sshkey diff --git a/zuul.yaml b/zuul.yaml index 86c85b9..e2b33a5 100644 --- a/zuul.yaml +++ b/zuul.yaml @@ -11,6 +11,7 @@ It also sets a default timeout value (which may be overidden). pre-run: playbooks/base/pre.yaml post-run: playbooks/base/post.yaml + cleanup-run: playbooks/base/cleanup.yaml roles: - zuul: opendev.org/zuul/zuul-jobs timeout: 1800