diff --git a/defaults/main.yml b/defaults/main.yml index 288496b..0f90495 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -25,36 +25,12 @@ rally_system_user_shell: /bin/false rally_system_user_home: "/var/lib/{{ rally_system_user_name }}" rally_etc_directory: /etc/rally -# We comment `rally_git_repo` so that the repo_build role does not attempt to -# build the wheel from this repo/branch. Instead, we want rally to get built -# from the stable release defined in rally_pip_packages further down in this -# file. -#rally_git_repo: https://git.openstack.org/openstack/rally -rally_git_install_branch: master -rally_developer_mode: false -rally_developer_constraints: - - "git+{{ rally_git_repo }}@{{ rally_git_install_branch }}#egg=rally" - -# TODO(odyssey4me): -# This can be simplified once all the roles are using -# python_venv_build. We can then switch to using a -# set of constraints in pip.conf inside the venv, -# perhaps prepared by giving a giving a list of -# constraints to the role. -rally_pip_install_args: >- - {{ rally_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }} - {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''), '') }} - {{ pip_install_options | default('') }} +rally_pip_install_args: "{{ pip_install_options | default('') }}" # Name of the virtual env to deploy into rally_venv_tag: "{{ venv_tag | default('untagged') }}" rally_bin: "/openstack/venvs/rally-{{ rally_venv_tag }}/bin" -# venv_download, even when true, will use the fallback method of building the -# venv from scratch if the venv download fails. -rally_venv_download: "{{ not rally_developer_mode | bool }}" -rally_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/rally.tgz - # Database vars rally_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}" rally_galera_address: "{{ galera_address | default('127.0.0.1') }}" diff --git a/tasks/main.yml b/tasks/main.yml index 3b4d3d5..651d0b7 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -29,7 +29,18 @@ tags: - rally-install -- include_tasks: rally_install.yml +- name: Install the python venv + import_role: + name: "python_venv_build" + vars: + venv_install_destination_path: "{{ rally_bin | dirname }}" + venv_install_distro_package_list: "{{ rally_distro_packages }}" + venv_pip_install_args: "{{ rally_pip_install_args }}" + venv_pip_packages: "{{ rally_pip_packages }}" + venv_facts_when_changed: + - section: "rally" + option: "venv_tag" + value: "{{ rally_venv_tag }}" tags: - rally-install diff --git a/tasks/rally_install.yml b/tasks/rally_install.yml deleted file mode 100644 index 4cde49a..0000000 --- a/tasks/rally_install.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -# Copyright 2016, Comcast Corporation -# -# 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. - -# TODO(odyssey4me): -# This can be simplified once all the roles are using -# python_venv_build. We can then switch to using a -# set of constraints in pip.conf inside the venv, -# perhaps prepared by giving a giving a list of -# constraints to the role. -- name: Create developer mode constraint file - copy: - dest: "/opt/developer-pip-constraints.txt" - content: | - {% for item in rally_developer_constraints %} - {{ item }} - {% endfor %} - when: rally_developer_mode | bool - -- name: Ensure remote wheel building is disabled in developer mode - set_fact: - venv_build_host: "{{ ansible_hostname }}" - when: - - rally_developer_mode | bool - -- name: Install the python venv - include_role: - name: "python_venv_build" - vars: - venv_install_destination_path: "{{ rally_bin | dirname }}" - venv_install_distro_package_list: "{{ rally_distro_packages }}" - venv_pip_install_args: "{{ rally_pip_install_args }}" - venv_pip_packages: "{{ rally_pip_packages }}" - venv_facts_when_changed: - - section: "rally" - option: "venv_tag" - value: "{{ rally_venv_tag }}"