From e46d60253626cfb793d7439b9cab5186760eac30 Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Fri, 6 Dec 2019 17:30:55 +0000
Subject: [PATCH] Use local python interpreter for keystone cron generator

We generate the keystone cron schedule via a python script on localhost.
Currently this always uses 'python', however this may not be available
on some systems.

This change switches to use the same python interpreter as used by
ansible-playbook.

Partially-Implements: blueprint python-3

Change-Id: I6007f8d6880f418a503766cec21a330c44e5b80f
---
 ansible/roles/keystone/tasks/config.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ansible/roles/keystone/tasks/config.yml b/ansible/roles/keystone/tasks/config.yml
index 75d9b98196..1b4c2cf6bf 100644
--- a/ansible/roles/keystone/tasks/config.yml
+++ b/ansible/roles/keystone/tasks/config.yml
@@ -172,7 +172,7 @@
 
 - name: Generate the required cron jobs for the node
   command: >
-    python {{ role_path }}/files/fernet_rotate_cron_generator.py
+    {{ ansible_playbook_python }} {{ role_path }}/files/fernet_rotate_cron_generator.py
     -t {{ (fernet_key_rotation_interval | int) // 60 }}
     -i {{ groups['keystone'].index(inventory_hostname) }}
     -n {{ (groups['keystone'] | length) }}