cleanup: move venv install into main to avoid extra include

This change moves the include file which has a single task to
the main to make it easier to understand.

It also changes the task to use import_role instead which should
handle tags much better.

Change-Id: I872850bd228c21a03209f76b32dafe6438a89dbe
This commit is contained in:
Mohammed Naser 2019-03-27 09:31:13 -04:00
parent 64615992b9
commit f8b18979e8
2 changed files with 14 additions and 30 deletions

View File

@ -1,29 +0,0 @@
---
# Copyright 2014, 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: Install the python venv
include_role:
name: "python_venv_build"
vars:
venv_build_constraints: "{{ magnum_git_constraints }}"
venv_install_destination_path: "{{ magnum_bin | dirname }}"
venv_install_distro_package_list: "{{ magnum_distro_packages }}"
venv_pip_install_args: "{{ magnum_pip_install_args }}"
venv_pip_packages: "{{ magnum_pip_packages | union(magnum_user_pip_packages) +
(magnum_oslomsg_amqp1_enabled | bool) | ternary(magnum_optional_oslomsg_amqp1_pip_packages, []) }}"
venv_facts_when_changed:
- section: "magnum"
option: "venv_tag"
value: "{{ magnum_venv_tag }}"

View File

@ -27,7 +27,20 @@
tags:
- magnum-install
- include_tasks: magnum_install.yml
- name: Install the python venv
import_role:
name: "python_venv_build"
vars:
venv_build_constraints: "{{ magnum_git_constraints }}"
venv_install_destination_path: "{{ magnum_bin | dirname }}"
venv_install_distro_package_list: "{{ magnum_distro_packages }}"
venv_pip_install_args: "{{ magnum_pip_install_args }}"
venv_pip_packages: "{{ magnum_pip_packages | union(magnum_user_pip_packages) +
(magnum_oslomsg_amqp1_enabled | bool) | ternary(magnum_optional_oslomsg_amqp1_pip_packages, []) }}"
venv_facts_when_changed:
- section: "magnum"
option: "venv_tag"
value: "{{ magnum_venv_tag }}"
tags:
- magnum-install