Update role for new source build process
The variables panko_developer_mode and panko_venv_download no longer carry any meaning. This review changes panko 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 installation 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. We also change include_tasks to import_tasks and include_role to import_role so that the tags in the python_venv_build role will work. Change-Id: I82f9eceb171befc1a47d18134fcc6c1482f14eef
This commit is contained in:
parent
ba960c0a86
commit
a3b0443be5
|
@ -25,38 +25,22 @@ panko_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_py
|
|||
panko_package_state: "latest"
|
||||
panko_pip_package_state: "latest"
|
||||
|
||||
## Toggle developer mode
|
||||
panko_developer_mode: false
|
||||
|
||||
## The git source/branch
|
||||
panko_git_repo: https://git.openstack.org/openstack/panko
|
||||
panko_git_install_branch: master
|
||||
|
||||
## The packages to build from source (used in developer mode)
|
||||
panko_developer_constraints:
|
||||
## The packages to build from source
|
||||
panko_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')) }}"
|
||||
panko_git_constraints:
|
||||
- "git+{{ panko_git_repo }}@{{ panko_git_install_branch }}#egg=panko"
|
||||
- "--constraint {{ panko_upper_constraints_url }}"
|
||||
|
||||
# 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.
|
||||
panko_pip_install_args: >-
|
||||
{{ panko_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('') }}
|
||||
panko_pip_install_args: "{{ pip_install_options | default('') }}"
|
||||
|
||||
# Name of the virtual env to deploy into
|
||||
panko_venv_tag: "{{ venv_tag | default('untagged') }}"
|
||||
panko_bin: "/openstack/venvs/panko-{{ panko_venv_tag }}/bin"
|
||||
|
||||
# venv_download, even when true, will use the fallback method of building the
|
||||
# venv from scratch if the venv download fails.
|
||||
panko_venv_download: "{{ not panko_developer_mode | bool }}"
|
||||
# URL of the pre-built virtualenv
|
||||
panko_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/panko.tgz
|
||||
|
||||
## System info
|
||||
panko_system_user_name: panko
|
||||
panko_system_group_name: panko
|
||||
|
|
|
@ -32,28 +32,41 @@
|
|||
tags:
|
||||
- always
|
||||
|
||||
- include_tasks: panko_pre_install.yml
|
||||
- import_tasks: panko_pre_install.yml
|
||||
tags:
|
||||
- panko-install
|
||||
|
||||
- include_tasks: panko_install.yml
|
||||
- name: Install the python venv
|
||||
import_role:
|
||||
name: "python_venv_build"
|
||||
vars:
|
||||
venv_build_constraints: "{{ panko_git_constraints }}"
|
||||
venv_build_distro_package_list: "{{ panko_devel_distro_packages }}"
|
||||
venv_install_destination_path: "{{ panko_bin | dirname }}"
|
||||
venv_install_distro_package_list: "{{ panko_distro_packages }}"
|
||||
venv_pip_install_args: "{{ panko_pip_install_args }}"
|
||||
venv_pip_packages: "{{ panko_pip_packages }}"
|
||||
venv_facts_when_changed:
|
||||
- section: "panko"
|
||||
option: "venv_tag"
|
||||
value: "{{ panko_venv_tag }}"
|
||||
tags:
|
||||
- panko-install
|
||||
|
||||
- include_tasks: panko_post_install.yml
|
||||
- import_tasks: panko_post_install.yml
|
||||
tags:
|
||||
- panko-config
|
||||
|
||||
- include_tasks: panko_db_setup.yml
|
||||
- import_tasks: panko_db_setup.yml
|
||||
when: inventory_hostname == groups['panko_all'][0]
|
||||
tags:
|
||||
- panko-config
|
||||
|
||||
- include_tasks: panko_apache.yml
|
||||
- import_tasks: panko_apache.yml
|
||||
tags:
|
||||
- panko-config
|
||||
|
||||
- include_tasks: panko_service_setup.yml
|
||||
- import_tasks: panko_service_setup.yml
|
||||
when: inventory_hostname == groups['panko_api'][0]
|
||||
tags:
|
||||
- panko-config
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
---
|
||||
# Copyright 2015, 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.
|
||||
|
||||
# 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 panko_developer_constraints %}
|
||||
{{ item }}
|
||||
{% endfor %}
|
||||
when: panko_developer_mode | bool
|
||||
|
||||
- name: Ensure remote wheel building is disabled in developer mode
|
||||
set_fact:
|
||||
venv_build_host: "{{ ansible_hostname }}"
|
||||
when:
|
||||
- panko_developer_mode | bool
|
||||
|
||||
- name: Install the python venv
|
||||
include_role:
|
||||
name: "python_venv_build"
|
||||
private: yes
|
||||
vars:
|
||||
venv_build_distro_package_list: "{{ panko_devel_distro_packages }}"
|
||||
venv_install_destination_path: "{{ panko_bin | dirname }}"
|
||||
venv_install_distro_package_list: "{{ panko_distro_packages }}"
|
||||
venv_pip_install_args: "{{ panko_pip_install_args }}"
|
||||
venv_pip_packages: "{{ panko_pip_packages }}"
|
||||
venv_facts_when_changed:
|
||||
- section: "panko"
|
||||
option: "venv_tag"
|
||||
value: "{{ panko_venv_tag }}"
|
|
@ -16,7 +16,6 @@
|
|||
panko_container_db_password: "secrete"
|
||||
panko_db_address: "{{ test_galera_host }}"
|
||||
panko_venv_tag: "testing"
|
||||
panko_developer_mode: true
|
||||
panko_service_password: "secrete"
|
||||
panko_service_publicuri: "{{ panko_service_proto }}://{{ hostvars[groups['panko_all'][0]]['ansible_host'] }}:{{ panko_service_port }}"
|
||||
panko_service_internaluri: "{{ panko_service_proto }}://{{ hostvars[groups['panko_all'][0]]['ansible_host'] }}:{{ panko_service_port }}"
|
||||
|
|
Loading…
Reference in New Issue