Enable developer mode
This commit adds the ability to install glance without a repo server. This pattern is lifted from the os_keystone role and allows us to further develop functional testing for this role. Change-Id: I39d13e70aaf4bb7ccd8411b19d16c57b8b3ffeb7 Partial-Bug: #1553960
This commit is contained in:
parent
4f6ec5fda4
commit
f4454345f6
@ -20,6 +20,12 @@ verbose: True
|
||||
## APT Cache options
|
||||
cache_timeout: 600
|
||||
|
||||
glance_git_repo: https://git.openstack.org/openstack/glance
|
||||
glance_git_install_branch: master
|
||||
glance_developer_mode: false
|
||||
glance_developer_constraints:
|
||||
- "git+{{ glance_git_repo }}@{{ glance_git_install_branch }}#egg=glance"
|
||||
|
||||
# Name of the virtual env to deploy into
|
||||
glance_venv_tag: untagged
|
||||
glance_venv_bin: "/openstack/venvs/glance-{{ glance_venv_tag }}/bin"
|
||||
|
@ -33,4 +33,6 @@ dependencies:
|
||||
- apt_package_pinning
|
||||
- galera_client
|
||||
- openstack_openrc
|
||||
- pip_lock_down
|
||||
- role: pip_lock_down
|
||||
when:
|
||||
- not glance_developer_mode | bool
|
||||
|
@ -30,6 +30,28 @@
|
||||
tags:
|
||||
- glance-apt-packages
|
||||
|
||||
- name: Create developer mode constraint file
|
||||
copy:
|
||||
dest: "/opt/developer-pip-constraints.txt"
|
||||
content: |
|
||||
{% for item in glance_developer_constraints %}
|
||||
{{ item }}
|
||||
{% endfor %}
|
||||
when:
|
||||
- glance_developer_mode | bool
|
||||
tags:
|
||||
- glance-install
|
||||
- glance-pip-packages
|
||||
|
||||
- name: Set constraint file fact for developer mode
|
||||
set_fact:
|
||||
pip_install_options: "{{ pip_install_options|default('') }} --constraint /opt/developer-pip-constraints.txt"
|
||||
when:
|
||||
- glance_developer_mode | bool
|
||||
tags:
|
||||
- glance-install
|
||||
- glance-pip-packages
|
||||
|
||||
- name: Install apt packages
|
||||
apt:
|
||||
pkg: "{{ item }}"
|
||||
@ -61,7 +83,9 @@
|
||||
stat:
|
||||
path: "/var/cache/{{ glance_venv_download_url | basename }}"
|
||||
get_md5: False
|
||||
when: glance_venv_enabled | bool
|
||||
when:
|
||||
- not glance_developer_mode | bool
|
||||
- glance_venv_enabled | bool
|
||||
register: local_venv_stat
|
||||
tags:
|
||||
- glance-install
|
||||
@ -71,7 +95,9 @@
|
||||
uri:
|
||||
url: "{{ glance_venv_download_url | replace('tgz', 'checksum') }}"
|
||||
return_content: True
|
||||
when: glance_venv_enabled | bool
|
||||
when:
|
||||
- not glance_developer_mode | bool
|
||||
- glance_venv_enabled | bool
|
||||
register: remote_venv_checksum
|
||||
tags:
|
||||
- glance-install
|
||||
@ -90,6 +116,7 @@
|
||||
ignore_errors: true
|
||||
register: get_venv
|
||||
when:
|
||||
- not glance_developer_mode | bool
|
||||
- glance_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 }})
|
||||
@ -121,6 +148,7 @@
|
||||
path: "{{ glance_venv_bin | dirname }}"
|
||||
state: directory
|
||||
when:
|
||||
- not glance_developer_mode | bool
|
||||
- glance_venv_enabled | bool
|
||||
- glance_get_venv | changed
|
||||
tags:
|
||||
@ -133,6 +161,7 @@
|
||||
dest: "{{ glance_venv_bin | dirname }}"
|
||||
copy: "no"
|
||||
when:
|
||||
- not glance_developer_mode | bool
|
||||
- glance_venv_enabled | bool
|
||||
- glance_get_venv | changed
|
||||
notify:
|
||||
@ -145,6 +174,7 @@
|
||||
command: >
|
||||
virtualenv-tools --update-path=auto {{ glance_venv_bin | dirname }}
|
||||
when:
|
||||
- not glance_developer_mode | bool
|
||||
- glance_venv_enabled | bool
|
||||
- glance_get_venv | success
|
||||
tags:
|
||||
@ -165,7 +195,7 @@
|
||||
with_items: glance_pip_packages
|
||||
when:
|
||||
- glance_venv_enabled | bool
|
||||
- glance_get_venv | failed
|
||||
- glance_get_venv | failed or glance_developer_mode | bool
|
||||
notify:
|
||||
- Restart glance services
|
||||
tags:
|
||||
@ -182,7 +212,9 @@
|
||||
retries: 5
|
||||
delay: 2
|
||||
with_items: glance_pip_packages
|
||||
when: not glance_venv_enabled | bool
|
||||
when:
|
||||
- not glance_venv_enabled | bool
|
||||
- not glance_developer_mode | bool
|
||||
notify:
|
||||
- Restart glance services
|
||||
tags:
|
||||
|
Loading…
Reference in New Issue
Block a user