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: I8bb1ff09d676ce3d2faa2baee385695bffb2db59
This commit is contained in:
Logan V
2017年01月13日 19:52:41 -06:00
parent 549d009f8d
commit 074ae8281b

View File

@@ -38,6 +38,9 @@ cloudkitty_system_home_folder: "/var/lib/{{ cloudkitty_system_user_name }}"
cloudkitty_venv_tag:untagged
cloudkitty_bin:"/openstack/venvs/cloudkitty-{{ cloudkitty_venv_tag }}/bin"
# venv_download, even when true, will use the fallback method of building the
# venv from scratch if the venv download fails.
cloudkitty_venv_download:"{{ not cloudkitty_developer_mode | bool }}"
cloudkitty_venv_download_url:http://127.0.0.1/venvs/untagged/ubuntu/cloudkitty.tgz
cloudkitty_git_repo:https://git.openstack.org/openstack/cloudkitty

View File

@@ -60,7 +60,7 @@
dest:"/var/cache/{{ cloudkitty_venv_download_url | basename }}"
checksum:"sha1:{{ lookup('url', cloudkitty_venv_download_url | replace('tgz', 'checksum')) }}"
register:cloudkitty_get_venv
when:not cloudkitty_developer_mode | bool
when:cloudkitty_venv_download | bool
tags:
- cloudkitty-install
- cloudkitty-pip-packages
@@ -79,6 +79,7 @@
path:"{{ cloudkitty_bin | dirname }}"
state:directory
register:cloudkitty_venv_dir
when:cloudkitty_get_venv | changed
tags:
- cloudkitty-install
- cloudkitty-pip-packages
@@ -88,9 +89,7 @@
src:"/var/cache/{{ cloudkitty_venv_download_url | basename }}"
dest:"{{ cloudkitty_bin | dirname }}"
copy:"no"
when:
- not cloudkitty_developer_mode | bool
- cloudkitty_get_venv | changed or cloudkitty_venv_dir | changed
when:cloudkitty_get_venv | changed
notify:
- Restart cloudkitty services
tags:
@@ -111,7 +110,7 @@
until:install_packages|success
retries:5
delay:2
when:cloudkitty_developer_mode | bool
when:cloudkitty_get_venv | failed or cloudkitty_get_venv | skipped
notify:
- Restart cloudkitty services
tags:
@@ -121,9 +120,7 @@
- name:Update virtualenv path
command:>
virtualenv-tools --update-path=auto --reinitialize {{ cloudkitty_bin | dirname }}
when:
- not cloudkitty_developer_mode | bool
- cloudkitty_get_venv | changed or cloudkitty_venv_dir | changed
when:cloudkitty_get_venv | changed
tags:
- cloudkitty-install
- cloudkitty-pip-packages
Reference in New Issue
openstack/openstack-ansible-os_cloudkitty
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.