From 581f180986ce5bae406723666500e5dae5b04554 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Mon, 19 Feb 2018 13:28:33 +0000 Subject: [PATCH] Use realpath filter instead of the stat/dir dance We can make the deployment more efficient if we use the realpath filter, instead of first checking for the directory and then implementing the changes in a follow-up task. This is more readable, simpler and faster to execute. Change-Id: I6cfe8f0ef8fb1b3ebd8e68bf3bdd0aaf4b96e523 (cherry picked from commit b4140c9eedaedc86ca2675695ff241da7644cc81) --- tasks/tempest_post_install.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tasks/tempest_post_install.yml b/tasks/tempest_post_install.yml index 7739b39c..bf4b11c8 100644 --- a/tasks/tempest_post_install.yml +++ b/tasks/tempest_post_install.yml @@ -31,11 +31,6 @@ set_fact: tempest_admin_tenant_id: "{{ keystone_facts.id }}" -- name: Stat for tempest log dir - stat: - path: "{{ tempest_log_dir }}" - register: _tempest_log_dir_check - - name: Create tempest directories file: path: "{{ item.path }}" @@ -44,7 +39,7 @@ group: "root" mode: "{{ item.mode|default('0755') }}" with_items: - - path: "{{ (_tempest_log_dir_check.stat.exists and _tempest_log_dir_check.stat.islnk) | ternary(_tempest_log_dir_check.stat.lnk_source, tempest_log_dir) }}" + - path: "{{ tempest_log_dir | realpath }}" - path: "{{ ansible_env.HOME }}/.tempest/etc" - path: "{{ tempest_image_dir }}"