diff --git a/defaults/main.yml b/defaults/main.yml index 38198849..1bf1e17b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -28,6 +28,9 @@ cinder_developer_constraints: cinder_venv_tag: untagged 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 # Enable/Disable Ceilometer diff --git a/tasks/cinder_install.yml b/tasks/cinder_install.yml index d4033063..1ded1f94 100644 --- a/tasks/cinder_install.yml +++ b/tasks/cinder_install.yml @@ -82,7 +82,7 @@ dest: "/var/cache/{{ cinder_venv_download_url | basename }}" checksum: "sha1:{{ lookup('url', cinder_venv_download_url | replace('tgz', 'checksum')) }}" register: cinder_get_venv - when: not cinder_developer_mode | bool + when: cinder_venv_download | bool - name: Remove existing venv file: @@ -95,18 +95,14 @@ path: "{{ cinder_bin | dirname }}" state: directory register: cinder_venv_dir - when: - - not cinder_developer_mode | bool - - cinder_get_venv | changed + when: cinder_get_venv | changed - name: Unarchive pre-built venv unarchive: src: "/var/cache/{{ cinder_venv_download_url | basename }}" dest: "{{ cinder_bin | dirname }}" copy: "no" - when: - - not cinder_developer_mode | bool - - cinder_get_venv | changed or cinder_venv_dir | changed + when: cinder_get_venv | changed notify: Restart cinder services - name: Install pip packages @@ -123,7 +119,7 @@ until: install_packages|success retries: 5 delay: 2 - when: cinder_developer_mode | bool + when: cinder_get_venv | failed or cinder_get_venv | skipped notify: Restart cinder services - name: CentOS remove python from path first @@ -132,12 +128,9 @@ state: "absent" when: - ansible_pkg_mgr == 'yum' - - not cinder_developer_mode | bool - - cinder_get_venv | changed or cinder_venv_dir | changed + - cinder_get_venv | changed - name: Update virtualenv path command: > virtualenv-tools --update-path=auto --reinitialize {{ cinder_bin | dirname }} - when: - - not cinder_developer_mode | bool - - cinder_get_venv | changed or cinder_venv_dir | changed + when: cinder_get_venv | changed