Merge "Re-deploy the Neutron venv if it mismatches the repo"
This commit is contained in:
commit
f12e6d9c9a
@ -328,6 +328,7 @@ neutron_requires_pip_packages:
|
||||
- virtualenv
|
||||
- virtualenv-tools
|
||||
- python-keystoneclient # Keystoneclient needed to OSA keystone lib
|
||||
- httplib2
|
||||
|
||||
neutron_pip_packages:
|
||||
- configobj
|
||||
|
@ -80,13 +80,42 @@
|
||||
- neutron-install
|
||||
- neutron-pip-packages
|
||||
|
||||
- name: Get local venv checksum
|
||||
stat:
|
||||
path: "/var/cache/{{ neutron_venv_download_url | basename }}"
|
||||
get_md5: False
|
||||
when: neutron_venv_enabled | bool
|
||||
register: local_venv_stat
|
||||
tags:
|
||||
- neutron-install
|
||||
- neutron-pip-packages
|
||||
|
||||
- name: Get remote venv checksum
|
||||
uri:
|
||||
url: "{{ neutron_venv_download_url | replace('tgz', 'checksum') }}"
|
||||
return_content: True
|
||||
when: neutron_venv_enabled | bool
|
||||
register: remote_venv_checksum
|
||||
tags:
|
||||
- neutron-install
|
||||
- neutron-pip-packages
|
||||
|
||||
# TODO: When project moves to ansible 2 we can pass this a sha256sum which will:
|
||||
# a) allow us to remove force: yes
|
||||
# b) allow the module to calculate the checksum of dest file which would
|
||||
# result in file being downloaded only if provided and dest sha256sum
|
||||
# checksums differ
|
||||
- name: Attempt venv download
|
||||
get_url:
|
||||
url: "{{ neutron_venv_download_url }}"
|
||||
dest: "/var/cache/{{ neutron_venv_download_url | basename }}"
|
||||
force: yes
|
||||
ignore_errors: true
|
||||
register: get_venv
|
||||
when: neutron_venv_enabled | bool
|
||||
when:
|
||||
- neutron_venv_enabled | bool
|
||||
- (local_venv_stat.stat.exists == False or
|
||||
{{ local_venv_stat.stat.checksum is defined and local_venv_stat.stat.checksum != remote_venv_checksum.content | trim }})
|
||||
tags:
|
||||
- neutron-install
|
||||
- neutron-pip-packages
|
||||
@ -99,13 +128,24 @@
|
||||
- neutron-install
|
||||
- neutron-pip-packages
|
||||
|
||||
- name: Remove existing venv
|
||||
file:
|
||||
path: "{{ neutron_venv_bin | dirname }}"
|
||||
state: absent
|
||||
when:
|
||||
- neutron_venv_enabled | bool
|
||||
- neutron_get_venv | changed
|
||||
tags:
|
||||
- neutron-install
|
||||
- neutron-pip-packages
|
||||
|
||||
- name: Create neutron venv dir
|
||||
file:
|
||||
path: "{{ neutron_venv_bin | dirname }}"
|
||||
state: directory
|
||||
when:
|
||||
- neutron_venv_enabled | bool
|
||||
- neutron_get_venv | success
|
||||
- neutron_get_venv | changed
|
||||
tags:
|
||||
- neutron-install
|
||||
- neutron-pip-packages
|
||||
@ -117,7 +157,8 @@
|
||||
copy: "no"
|
||||
when:
|
||||
- neutron_venv_enabled | bool
|
||||
- neutron_get_venv | success
|
||||
- neutron_get_venv | changed
|
||||
notify: Restart neutron services
|
||||
tags:
|
||||
- neutron-install
|
||||
- neutron-pip-packages
|
||||
@ -147,6 +188,7 @@
|
||||
when:
|
||||
- neutron_venv_enabled | bool
|
||||
- neutron_get_venv | failed
|
||||
notify: Restart neutron services
|
||||
tags:
|
||||
- neutron-install
|
||||
- neutron-pip-packages
|
||||
@ -162,6 +204,7 @@
|
||||
delay: 2
|
||||
with_items: neutron_pip_packages
|
||||
when: not neutron_venv_enabled | bool
|
||||
notify: Restart neutron services
|
||||
tags:
|
||||
- neutron-install
|
||||
- neutron-pip-packages
|
||||
|
Loading…
x
Reference in New Issue
Block a user