Files
ansible-role-python_venv_build/tasks/python_venv_preflight.yml
Jonathan Rosser e7a165b1d0 Remove the virtualenv version check
Simplify this code by making the assumption that we always have a
new enough version of virtualenv present. Centos-7 ships 15.1.0 so
it is now possible to remove some conditional logic as well.

This patch removes the version check and replaces it with a check
that the virtualenv command is present on the system patch and
is usable.

Change-Id: I1a8f4961358c9551c5493b332187b411177b2769
(cherry picked from commit aabd3c07c2)
2020-07-06 17:57:24 +00:00

36 lines
1.1 KiB
YAML

---
# Copyright 2018, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Verify that venv_install_destination_path has been provided
fail:
msg: |
The variable venv_install_destination_path is required and
has not been set.
when:
- venv_install_destination_path is not defined
- name: Check for virtualenv command being available on system path
command: 'which virtualenv'
register: virtualenv_installed
ignore_errors: yes
changed_when: false
- name: Fail when required virtualenv is not present
fail:
msg: >-
The command 'virtualenv' version is not present.
when:
virtualenv_installed.rc != 0