diff --git a/defaults/main.yml b/defaults/main.yml index 6e547df..23552db 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -51,6 +51,9 @@ monasca_service_adminurl: "{{ monasca_service_adminuri_proto }}://{{ internal_lb # Name of the virtual env to deploy into monasca_venv_tag: untagged +# venv_download, even when true, will use the fallback method of building the +# venv from scratch if the venv download fails. +monasca_venv_download: "{{ not monasca_developer_mode | bool }}" monasca_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/monasca.tgz monasca_bin: "/openstack/venvs/monasca-{{ monasca_venv_tag }}/bin" diff --git a/tasks/install.yml b/tasks/install.yml index 88e2419..df4e87c 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -47,7 +47,7 @@ dest: "/var/cache/{{ monasca_venv_download_url | basename }}" checksum: "sha1:{{ lookup('url', monasca_venv_download_url | replace('tgz', 'checksum')) }}" register: monasca_get_venv - when: not monasca_developer_mode | bool + when: monasca_venv_download | bool - name: Remove existing venv file: @@ -60,15 +60,14 @@ path: "{{ monasca_bin | dirname }}" state: directory register: monasca_venv_dir + when: monasca_get_venv | changed - name: Unarchive pre-built venv unarchive: src: "/var/cache/{{ monasca_venv_download_url | basename }}" dest: "{{ monasca_bin | dirname }}" copy: "no" - when: - - not monasca_developer_mode | bool - - monasca_get_venv | changed or monasca_venv_dir | changed + when: monasca_get_venv | changed notify: - Restart monasca services @@ -86,12 +85,10 @@ until: install_packages|success retries: 5 delay: 2 - when: monasca_developer_mode | bool + when: monasca_get_venv | failed or monasca_get_venv | skipped notify: Restart monasca services - name: Update virtualenv path command: > virtualenv-tools --update-path=auto --reinitialize {{ monasca_bin | dirname }} - when: - - not monasca_developer_mode | bool - - monasca_get_venv | changed or monasca_venv_dir | changed + when: monasca_get_venv | changed