Enable developer mode

This commit adds the ability to install nova 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: Ifb1c4140a33dc1d3de7f0f2741e51191efd989db
This commit is contained in:
Matt Thompson 2016-03-08 15:36:33 +00:00
parent 18e2417214
commit cfae5455f4
3 changed files with 45 additions and 5 deletions

View File

@ -23,6 +23,12 @@ verbose: True
## APT Cache options
cache_timeout: 600
nova_git_repo: https://git.openstack.org/openstack/nova
nova_git_install_branch: master
nova_developer_mode: false
nova_developer_constraints:
- "git+{{ nova_git_repo }}@{{ nova_git_install_branch }}#egg=nova"
# Name of the virtual env to deploy into
nova_venv_tag: untagged
nova_venv_bin: "/openstack/venvs/nova-{{ nova_venv_tag }}/bin"

View File

@ -33,4 +33,6 @@ dependencies:
- apt_package_pinning
- galera_client
- openstack_openrc
- pip_lock_down
- role: pip_lock_down
when:
- not nova_developer_mode | bool

View File

@ -43,6 +43,28 @@
- nova-install
- nova-apt-packages
- name: Create developer mode constraint file
copy:
dest: "/opt/developer-pip-constraints.txt"
content: |
{% for item in nova_developer_constraints %}
{{ item }}
{% endfor %}
when:
- nova_developer_mode | bool
tags:
- nova-install
- nova-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:
- nova_developer_mode | bool
tags:
- nova-install
- nova-pip-packages
- name: Install requires pip packages
pip:
name: "{{ item }}"
@ -61,7 +83,9 @@
stat:
path: "/var/cache/{{ nova_venv_download_url | basename }}"
get_md5: False
when: nova_venv_enabled | bool
when:
- not nova_developer_mode | bool
- nova_venv_enabled | bool
register: local_venv_stat
tags:
- nova-install
@ -71,7 +95,9 @@
uri:
url: "{{ nova_venv_download_url | replace('tgz', 'checksum') }}"
return_content: True
when: nova_venv_enabled | bool
when:
- not nova_developer_mode | bool
- nova_venv_enabled | bool
register: remote_venv_checksum
tags:
- nova-install
@ -90,6 +116,7 @@
ignore_errors: true
register: get_venv
when:
- not nova_developer_mode | bool
- nova_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: "{{ nova_venv_bin | dirname }}"
state: directory
when:
- not nova_developer_mode | bool
- nova_venv_enabled | bool
- nova_get_venv | changed
tags:
@ -133,6 +161,7 @@
dest: "{{ nova_venv_bin | dirname }}"
copy: "no"
when:
- not nova_developer_mode | bool
- nova_venv_enabled | bool
- nova_get_venv | changed
notify: Restart nova services
@ -144,6 +173,7 @@
command: >
virtualenv-tools --update-path=auto {{ nova_venv_bin | dirname }}
when:
- not nova_developer_mode | bool
- nova_venv_enabled | bool
- nova_get_venv | success
tags:
@ -164,7 +194,7 @@
with_items: nova_pip_packages
when:
- nova_venv_enabled | bool
- nova_get_venv | failed
- nova_get_venv | failed or nova_developer_mode | bool
notify: Restart nova services
tags:
- nova-install
@ -180,7 +210,9 @@
retries: 5
delay: 2
with_items: nova_pip_packages
when: not nova_venv_enabled | bool
when:
- not nova_developer_mode | bool
- not nova_venv_enabled | bool
notify: Restart nova services
tags:
- nova-install