Clean up developer mode logic
Fixes the ability to deploy a venv in cases where: 1) developer_mode is not enabled 2) A cached venv is not downloaded from the repo server Additional cleanup to the developer_mode venv deployment logic is implemented by adding a *_venv_download var which is used to decouple developer_mode from the cached venv extraction process so that a deployer can force venv builds in-place (disable cached venv usage) without enabling developer mode constraints. Change-Id: Id9571a51b3b3e0403eb51a01994a88f387ebfa9e
This commit is contained in:
parent
890f84d31d
commit
d14410b70d
@ -28,6 +28,9 @@ cinder_developer_constraints:
|
|||||||
cinder_venv_tag: untagged
|
cinder_venv_tag: untagged
|
||||||
cinder_bin: "/openstack/venvs/cinder-{{ cinder_venv_tag }}/bin"
|
cinder_bin: "/openstack/venvs/cinder-{{ cinder_venv_tag }}/bin"
|
||||||
|
|
||||||
|
# venv_download, even when true, will use the fallback method of building the
|
||||||
|
# venv from scratch if the venv download fails.
|
||||||
|
cinder_venv_download: "{{ not cinder_developer_mode | bool }}"
|
||||||
cinder_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/cinder.tgz
|
cinder_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/cinder.tgz
|
||||||
|
|
||||||
# Enable/Disable Ceilometer
|
# Enable/Disable Ceilometer
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
dest: "/var/cache/{{ cinder_venv_download_url | basename }}"
|
dest: "/var/cache/{{ cinder_venv_download_url | basename }}"
|
||||||
checksum: "sha1:{{ lookup('url', cinder_venv_download_url | replace('tgz', 'checksum')) }}"
|
checksum: "sha1:{{ lookup('url', cinder_venv_download_url | replace('tgz', 'checksum')) }}"
|
||||||
register: cinder_get_venv
|
register: cinder_get_venv
|
||||||
when: not cinder_developer_mode | bool
|
when: cinder_venv_download | bool
|
||||||
|
|
||||||
- name: Remove existing venv
|
- name: Remove existing venv
|
||||||
file:
|
file:
|
||||||
@ -95,18 +95,14 @@
|
|||||||
path: "{{ cinder_bin | dirname }}"
|
path: "{{ cinder_bin | dirname }}"
|
||||||
state: directory
|
state: directory
|
||||||
register: cinder_venv_dir
|
register: cinder_venv_dir
|
||||||
when:
|
when: cinder_get_venv | changed
|
||||||
- not cinder_developer_mode | bool
|
|
||||||
- cinder_get_venv | changed
|
|
||||||
|
|
||||||
- name: Unarchive pre-built venv
|
- name: Unarchive pre-built venv
|
||||||
unarchive:
|
unarchive:
|
||||||
src: "/var/cache/{{ cinder_venv_download_url | basename }}"
|
src: "/var/cache/{{ cinder_venv_download_url | basename }}"
|
||||||
dest: "{{ cinder_bin | dirname }}"
|
dest: "{{ cinder_bin | dirname }}"
|
||||||
copy: "no"
|
copy: "no"
|
||||||
when:
|
when: cinder_get_venv | changed
|
||||||
- not cinder_developer_mode | bool
|
|
||||||
- cinder_get_venv | changed or cinder_venv_dir | changed
|
|
||||||
notify: Restart cinder services
|
notify: Restart cinder services
|
||||||
|
|
||||||
- name: Install pip packages
|
- name: Install pip packages
|
||||||
@ -123,7 +119,7 @@
|
|||||||
until: install_packages|success
|
until: install_packages|success
|
||||||
retries: 5
|
retries: 5
|
||||||
delay: 2
|
delay: 2
|
||||||
when: cinder_developer_mode | bool
|
when: cinder_get_venv | failed or cinder_get_venv | skipped
|
||||||
notify: Restart cinder services
|
notify: Restart cinder services
|
||||||
|
|
||||||
- name: CentOS remove python from path first
|
- name: CentOS remove python from path first
|
||||||
@ -132,12 +128,9 @@
|
|||||||
state: "absent"
|
state: "absent"
|
||||||
when:
|
when:
|
||||||
- ansible_pkg_mgr == 'yum'
|
- ansible_pkg_mgr == 'yum'
|
||||||
- not cinder_developer_mode | bool
|
- cinder_get_venv | changed
|
||||||
- cinder_get_venv | changed or cinder_venv_dir | changed
|
|
||||||
|
|
||||||
- name: Update virtualenv path
|
- name: Update virtualenv path
|
||||||
command: >
|
command: >
|
||||||
virtualenv-tools --update-path=auto --reinitialize {{ cinder_bin | dirname }}
|
virtualenv-tools --update-path=auto --reinitialize {{ cinder_bin | dirname }}
|
||||||
when:
|
when: cinder_get_venv | changed
|
||||||
- not cinder_developer_mode | bool
|
|
||||||
- cinder_get_venv | changed or cinder_venv_dir | changed
|
|
||||||
|
Loading…
Reference in New Issue
Block a user