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 ## APT Cache options
cache_timeout: 600 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 # Name of the virtual env to deploy into
nova_venv_tag: untagged nova_venv_tag: untagged
nova_venv_bin: "/openstack/venvs/nova-{{ nova_venv_tag }}/bin" nova_venv_bin: "/openstack/venvs/nova-{{ nova_venv_tag }}/bin"

View File

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

View File

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