From 7a384b9ce4c8724b408132a71db9a2fffcf7839d Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Fri, 18 Dec 2020 17:16:01 +0000
Subject: [PATCH] CI: fix race condition in kolla-ansible-host-vars role tests

A temporary file is removed by multiple test hosts, which all have
connection=local. This leads to a race between multiple executions of
the file module on localhost.

Add run_once.

Change-Id: I976122f72bdca7f91cbfcd81fca431b81a6b6aef
---
 ansible/roles/kolla-ansible-host-vars/tests/test.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ansible/roles/kolla-ansible-host-vars/tests/test.yml b/ansible/roles/kolla-ansible-host-vars/tests/test.yml
index e2d3e391..5f1d7727 100644
--- a/ansible/roles/kolla-ansible-host-vars/tests/test.yml
+++ b/ansible/roles/kolla-ansible-host-vars/tests/test.yml
@@ -140,6 +140,7 @@
           file:
             path: "{{ temp_path }}"
             state: absent
+          run_once: true
 
         - name: Refresh the inventory
           meta: refresh_inventory
-- 
GitLab