
1. Variables have been renamed to make it easier to understand their purpose. 2. Unnecessary variables have been removed. 3. The role no longer caters to installing pip packages on the host. This should never be necessary - if it is, then something should do so beforehand. 4. The expected versions of pip/virtualenv are documented and a check has been added to ensure that they exist. 5. The handler has been named to make debug logs less confusing. 6. The default storage path for venvs/wheels is no longer opinionated. If paths based on distro/architecture are required then different paths should be provided to the role. Change-Id: I9eb96e9db22f918b00456af943d81f66050107ce
48 lines
1.6 KiB
YAML
48 lines
1.6 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.
|
|
|
|
- include_tasks: "python_venv_preflight.yml"
|
|
tags:
|
|
- always
|
|
|
|
# To ensure that only the first host in every distro/architecture
|
|
# group does the build, and the others make use of that build,
|
|
# without forcing the use of serialisation, we use a dynamic
|
|
# group based on the venv_distro_arch_grouping which combines
|
|
# the distribution/architecture and is therefore unique for mixed
|
|
# environments.
|
|
- name: Add hosts to dynamic inventory group to ensure build/install serialization
|
|
group_by:
|
|
key: "{{ venv_distro_arch_grouping }}"
|
|
tags:
|
|
- always
|
|
|
|
- include_tasks: "python_venv_build.yml"
|
|
when:
|
|
- (venv_build_only | bool) or
|
|
((_venv_source == 'file') and
|
|
(not _src_venv_present.stat.exists | bool))
|
|
- inventory_hostname == groups[venv_distro_arch_grouping][0]
|
|
|
|
- include_tasks: "python_venv_install.yml"
|
|
when:
|
|
- not venv_build_only | bool
|
|
- inventory_hostname != groups[venv_distro_arch_grouping][0]
|
|
|
|
- include_tasks: "python_venv_set_facts.yml"
|
|
when:
|
|
- not venv_build_only | bool
|
|
- venv_facts_when_changed != []
|