From ce67cef122057eb4f4c7d6356ea94d88371efa27 Mon Sep 17 00:00:00 2001
From: David Shrewsbury <dshrewsb@redhat.com>
Date: Thu, 31 Oct 2019 12:07:03 -0400
Subject: [PATCH] run-buildset-registry: Fix python version check

The "Start the buildset registry" task, which uses the
docker_container Ansible module, was failing with:

    "No module named 'requests'"

This is because the earlier package install task was installing
the packages into the wrong python version because the
ansible_python_interpreter value was 'auto' and thus never
included the 'python3' value.

Change-Id: I887fdf8d000c8b916fdab281c531b7c98bdd5ae2
---
 roles/run-buildset-registry/tasks/main.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/roles/run-buildset-registry/tasks/main.yaml b/roles/run-buildset-registry/tasks/main.yaml
index 23736e778..ecbbccce5 100644
--- a/roles/run-buildset-registry/tasks/main.yaml
+++ b/roles/run-buildset-registry/tasks/main.yaml
@@ -6,7 +6,7 @@
       - openssl
       - python-passlib
     state: present
-  when: "'python3' not in ansible_python_interpreter"
+  when: ansible_python_version is version('3', '<')
 - name: Install packages
   become: yes
   package:
@@ -15,7 +15,7 @@
       - openssl
       - python3-passlib
     state: present
-  when: "'python3' in ansible_python_interpreter"
+  when: ansible_python_version is version('3', '>=')
 - name: Ensure registry volume directories exists
   file:
     state: directory