From 28a4012f3b39cbb918f94c56362f58d8191e2822 Mon Sep 17 00:00:00 2001 From: Albin Vass Date: Thu, 20 Feb 2020 14:16:23 +0100 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: I4e8772e697dbb98e8adfa4f8693c3ff71bf02ba1 --- playbooks/base-test/cleanup.yaml | 3 +++ playbooks/base-test/post.yaml | 7 ------- playbooks/base/cleanup.yaml | 3 +++ zuul.yaml | 1 + 4 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 playbooks/base-test/cleanup.yaml create mode 100644 playbooks/base/cleanup.yaml diff --git a/playbooks/base-test/cleanup.yaml b/playbooks/base-test/cleanup.yaml new file mode 100644 index 0000000..d793838 --- /dev/null +++ b/playbooks/base-test/cleanup.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - remove-build-sshkey diff --git a/playbooks/base-test/post.yaml b/playbooks/base-test/post.yaml index 0318870..c810eab 100644 --- a/playbooks/base-test/post.yaml +++ b/playbooks/base-test/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/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/zuul.yaml b/zuul.yaml index 764b234..86c85b9 100644 --- a/zuul.yaml +++ b/zuul.yaml @@ -23,6 +23,7 @@ main job in production. Not for general use. pre-run: playbooks/base-test/pre.yaml post-run: playbooks/base-test/post.yaml + cleanup-run: playbooks/base-test/cleanup.yaml roles: - zuul: opendev.org/zuul/zuul-jobs timeout: 1800