Update role for new source build process
The variables magum_developer_mode and magnum_venv_download no longer carry any meaning. This review changes magnum to do the equivalent of what developer_mode was all the time, meaning that it always builds the venv and never requires the repo server, but it will use a repo server when available. As part of this, we move the source build out of its own file because it's now a single task to include the venv build role. This is just to make it easier to follow the code. Change-Id: I89177a702cd6f31f4b26b4d8fa260fd38a895ba0
This commit is contained in:
@@ -65,32 +65,19 @@ magnum_config_overrides: {}
|
||||
magnum_policy_overrides: {}
|
||||
magnum_api_paste_ini_overrides: {}
|
||||
|
||||
# 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.
|
||||
magnum_pip_install_args: >-
|
||||
{{ magnum_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('') }}
|
||||
magnum_pip_install_args: "{{ pip_install_options | default('') }}"
|
||||
|
||||
# Name of the virtual env to deploy into
|
||||
magnum_venv_tag: "{{ venv_tag | default('untagged') }}"
|
||||
magnum_venv_path: "/openstack/venvs/magnum-{{ magnum_venv_tag }}"
|
||||
magnum_bin: "{{ magnum_venv_path }}/bin"
|
||||
|
||||
# venv_download, even when true, will use the fallback method of building the
|
||||
# venv from scratch if the venv download fails.
|
||||
magnum_venv_download: "{{ not magnum_developer_mode | bool }}"
|
||||
magnum_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/magnum.tgz
|
||||
|
||||
magnum_git_repo: "https://git.openstack.org/openstack/magnum"
|
||||
magnum_git_install_branch: master
|
||||
magnum_developer_mode: false
|
||||
magnum_developer_constraints:
|
||||
magnum_upper_constraints_url: "{{ requirements_git_url | default('https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=' ~ requirements_git_install_branch | default('master')) }}"
|
||||
magnum_git_constraints:
|
||||
- "git+{{ magnum_git_repo }}@{{ magnum_git_install_branch }}#egg=magnum"
|
||||
- "--constraint {{ magnum_upper_constraints_url }}"
|
||||
|
||||
# Database vars
|
||||
magnum_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}"
|
||||
|
@@ -13,31 +13,11 @@
|
||||
# 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 magnum_developer_constraints %}
|
||||
{{ item }}
|
||||
{% endfor %}
|
||||
when: magnum_developer_mode | bool
|
||||
|
||||
- name: Ensure remote wheel building is disabled in developer mode
|
||||
set_fact:
|
||||
venv_build_host: "{{ ansible_hostname }}"
|
||||
when:
|
||||
- magnum_developer_mode | bool
|
||||
|
||||
- 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 }}"
|
||||
|
Reference in New Issue
Block a user