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: I52f58c358b0fbb5735e98683105fb98385a2abfe
This commit is contained in:
parent
c649c22462
commit
68ddfa4d80
@ -31,6 +31,9 @@ sahara_bin: "/openstack/venvs/sahara-{{ sahara_venv_tag }}/bin"
|
|||||||
|
|
||||||
sahara_etc_dir: "{{ sahara_bin | dirname }}/etc/sahara"
|
sahara_etc_dir: "{{ sahara_bin | dirname }}/etc/sahara"
|
||||||
|
|
||||||
|
# venv_download, even when true, will use the fallback method of building the
|
||||||
|
# venv from scratch if the venv download fails.
|
||||||
|
sahara_venv_download: "{{ not sahara_developer_mode | bool }}"
|
||||||
sahara_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/sahara.tgz
|
sahara_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/sahara.tgz
|
||||||
|
|
||||||
sahara_db_config: /etc/sahara/sahara.conf
|
sahara_db_config: /etc/sahara/sahara.conf
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
dest: "/var/cache/{{ sahara_venv_download_url | basename }}"
|
dest: "/var/cache/{{ sahara_venv_download_url | basename }}"
|
||||||
checksum: "sha1:{{ lookup('url', sahara_venv_download_url | replace('tgz', 'checksum')) }}"
|
checksum: "sha1:{{ lookup('url', sahara_venv_download_url | replace('tgz', 'checksum')) }}"
|
||||||
register: sahara_get_venv
|
register: sahara_get_venv
|
||||||
when: not sahara_developer_mode | bool
|
when: sahara_venv_download | bool
|
||||||
|
|
||||||
- name: Remove existing venv
|
- name: Remove existing venv
|
||||||
file:
|
file:
|
||||||
@ -57,15 +57,14 @@
|
|||||||
state: directory
|
state: directory
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
register: sahara_venv_dir
|
register: sahara_venv_dir
|
||||||
|
when: sahara_get_venv | changed
|
||||||
|
|
||||||
- name: Unarchive pre-built venv
|
- name: Unarchive pre-built venv
|
||||||
unarchive:
|
unarchive:
|
||||||
src: "/var/cache/{{ sahara_venv_download_url | basename }}"
|
src: "/var/cache/{{ sahara_venv_download_url | basename }}"
|
||||||
dest: "{{ sahara_bin | dirname }}"
|
dest: "{{ sahara_bin | dirname }}"
|
||||||
copy: "no"
|
copy: "no"
|
||||||
when:
|
when: sahara_get_venv | changed
|
||||||
- not sahara_developer_mode | bool
|
|
||||||
- sahara_get_venv | changed or sahara_venv_dir | changed
|
|
||||||
notify:
|
notify:
|
||||||
- Restart sahara services
|
- Restart sahara services
|
||||||
|
|
||||||
@ -83,7 +82,7 @@
|
|||||||
until: install_packages|success
|
until: install_packages|success
|
||||||
retries: 5
|
retries: 5
|
||||||
delay: 2
|
delay: 2
|
||||||
when: sahara_developer_mode | bool
|
when: sahara_get_venv | failed or sahara_get_venv | skipped
|
||||||
notify:
|
notify:
|
||||||
- Restart sahara services
|
- Restart sahara services
|
||||||
|
|
||||||
@ -93,12 +92,9 @@
|
|||||||
state: "absent"
|
state: "absent"
|
||||||
when:
|
when:
|
||||||
- ansible_pkg_mgr == 'yum'
|
- ansible_pkg_mgr == 'yum'
|
||||||
- not sahara_developer_mode | bool
|
- sahara_get_venv | changed
|
||||||
- sahara_get_venv | changed or sahara_venv_dir | changed
|
|
||||||
|
|
||||||
- name: Update virtualenv path
|
- name: Update virtualenv path
|
||||||
command: >
|
command: >
|
||||||
virtualenv-tools --update-path=auto --reinitialize {{ sahara_bin | dirname }}
|
virtualenv-tools --update-path=auto --reinitialize {{ sahara_bin | dirname }}
|
||||||
when:
|
when: sahara_get_venv | changed
|
||||||
- not sahara_developer_mode | bool
|
|
||||||
- sahara_get_venv | changed or sahara_venv_dir | changed
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user