From 88334b5a955ced36023b065704a5915fa58f0256 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 30 Nov 2018 14:50:48 +0000 Subject: [PATCH] Enable overriding the service setup host python interpreter In order to enable the service setup host python interpreter to be changed easily, we make it a variable. This will be useful when someone sets the service setup host to be the utility container, because we'll be able to set this var by default. Change-Id: I63b56c8003efab5a31b9322a865ccbad74022c09 --- defaults/main.yml | 1 + tasks/glance_service_setup.yml | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 8875cb8b..b402148b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -23,6 +23,7 @@ glance_install_method: "source" # for the service setup. The host must already have # clouds.yaml properly configured. glance_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}" +glance_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((glance_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}" # Set the package install state for distribution and pip packages # Options are 'present' and 'latest' diff --git a/tasks/glance_service_setup.yml b/tasks/glance_service_setup.yml index 3f2ac82e..bee49f49 100644 --- a/tasks/glance_service_setup.yml +++ b/tasks/glance_service_setup.yml @@ -21,8 +21,7 @@ - name: Setup the service delegate_to: "{{ glance_service_setup_host }}" vars: - ansible_python_interpreter: >- - {{ (glance_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable']) }} + ansible_python_interpreter: "{{ glance_service_setup_host_python_interpreter }}" block: - name: Add service to the keystone service catalog os_keystone_service: