Allow pypiserver to be upgraded before repo build
To cater for a situation where the pypiserver package is changing, but the repo does not yet have the package built, we need to ensure that the install task for it can fetch from pypi (or the designated pypi mirror). To do this we try the local repo first, then fall back to using the designated default index which defaults to pypi. Change-Id: I1a2d36793fccc4c50f00247c8d19501ad8816517
This commit is contained in:
parent
3e247f6f57
commit
4e3213f4c6
|
@ -55,7 +55,14 @@
|
||||||
retries: 5
|
retries: 5
|
||||||
delay: 2
|
delay: 2
|
||||||
|
|
||||||
- name: Install pip packages
|
# Note(odyssey4me):
|
||||||
|
# To cater for a situation where the pip packages are changing, but the repo
|
||||||
|
# does not yet have the package built, we need to ensure that this task can
|
||||||
|
# fetch from pypi. To do this we try the local repo first, then fall back to
|
||||||
|
# using pypi.
|
||||||
|
- name: Try installing from the repo first, then fall back to using pypi
|
||||||
|
block:
|
||||||
|
- name: Install pip packages (from repo)
|
||||||
pip:
|
pip:
|
||||||
name: "{{ repo_pypiserver_pip_packages }}"
|
name: "{{ repo_pypiserver_pip_packages }}"
|
||||||
state: "{{ repo_server_pip_package_state }}"
|
state: "{{ repo_server_pip_package_state }}"
|
||||||
|
@ -70,4 +77,22 @@
|
||||||
delay: 2
|
delay: 2
|
||||||
notify:
|
notify:
|
||||||
- reload pypiserver
|
- reload pypiserver
|
||||||
|
rescue:
|
||||||
|
- name: Install pip packages (from pypi mirror)
|
||||||
|
pip:
|
||||||
|
name: "{{ repo_pypiserver_pip_packages }}"
|
||||||
|
state: "{{ repo_server_pip_package_state }}"
|
||||||
|
virtualenv: "{{ repo_pypiserver_bin | dirname }}"
|
||||||
|
virtualenv_site_packages: "no"
|
||||||
|
extra_args: >-
|
||||||
|
--index-url {{ repo_build_pip_default_index | default('https://pypi.python.org/simple') }}
|
||||||
|
--trusted-host {{ (repo_build_pip_default_index | default('https://pypi.python.org/simple')) | netloc_no_port }}
|
||||||
|
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }}
|
||||||
|
{{ pip_install_options | default('') }}
|
||||||
|
register: install_packages
|
||||||
|
until: install_packages | success
|
||||||
|
retries: 5
|
||||||
|
delay: 2
|
||||||
|
notify:
|
||||||
|
- reload pypiserver
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue