Enable developer mode

This commit adds the ability to install neutron 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: I6a949ce79b7293efd1b966d253ee18f0339d87a4
Partial-Bug: #1553970
This commit is contained in:
Jimmy McCrory 2016-03-10 13:23:32 -08:00
parent ba11de3626
commit d750a0de32
3 changed files with 58 additions and 6 deletions

View File

@ -23,6 +23,25 @@ verbose: True
## APT Cache options
cache_timeout: 600
neutron_git_repo: https://git.openstack.org/openstack/neutron
neutron_git_install_branch: master
neutron_fwaas_git_repo: https://git.openstack.org/openstack/neutron-fwaas
neutron_fwaas_git_install_branch: master
neutron_lbaas_git_repo: https://git.openstack.org/openstack/neutron-lbaas
neutron_lbaas_git_install_branch: master
neutron_vpnaas_git_repo: https://git.openstack.org/openstack/neutron-vpnaas
neutron_vpnaas_git_install_branch: master
neutron_developer_mode: false
neutron_developer_constraints:
- "git+{{ neutron_git_repo }}@{{ neutron_git_install_branch }}#egg=neutron"
- "git+{{ neutron_fwaas_git_repo }}@{{ neutron_fwaas_git_install_branch }}#egg=neutron-fwaas"
- "git+{{ neutron_lbaas_git_repo }}@{{ neutron_lbaas_git_install_branch }}#egg=neutron-lbaas"
- "git+{{ neutron_vpnaas_git_repo }}@{{ neutron_vpnaas_git_install_branch }}#egg=neutron-vpnaas"
# Name of the virtual env to deploy into
neutron_venv_tag: untagged
neutron_venv_bin: "/openstack/venvs/neutron-{{ neutron_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 neutron_developer_mode | bool

View File

@ -72,6 +72,28 @@
- neutron-install
- neutron-apt-packages
- name: Create developer mode constraint file
copy:
dest: "/opt/developer-pip-constraints.txt"
content: |
{% for item in neutron_developer_constraints %}
{{ item }}
{% endfor %}
when:
- neutron_developer_mode | bool
tags:
- neutron-install
- neutron-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:
- neutron_developer_mode | bool
tags:
- neutron-install
- neutron-pip-packages
- name: Install requires pip packages
pip:
name: "{{ item }}"
@ -90,7 +112,9 @@
stat:
path: "/var/cache/{{ neutron_venv_download_url | basename }}"
get_md5: False
when: neutron_venv_enabled | bool
when:
- not neutron_developer_mode | bool
- neutron_venv_enabled | bool
register: local_venv_stat
tags:
- neutron-install
@ -100,7 +124,9 @@
uri:
url: "{{ neutron_venv_download_url | replace('tgz', 'checksum') }}"
return_content: True
when: neutron_venv_enabled | bool
when:
- not neutron_developer_mode | bool
- neutron_venv_enabled | bool
register: remote_venv_checksum
tags:
- neutron-install
@ -119,6 +145,7 @@
ignore_errors: true
register: get_venv
when:
- not neutron_developer_mode | bool
- 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 }})
@ -150,6 +177,7 @@
path: "{{ neutron_venv_bin | dirname }}"
state: directory
when:
- not neutron_developer_mode | bool
- neutron_venv_enabled | bool
- neutron_get_venv | changed
tags:
@ -162,6 +190,7 @@
dest: "{{ neutron_venv_bin | dirname }}"
copy: "no"
when:
- not neutron_developer_mode | bool
- neutron_venv_enabled | bool
- neutron_get_venv | changed
notify: Restart neutron services
@ -173,6 +202,7 @@
command: >
virtualenv-tools --update-path=auto {{ neutron_venv_bin | dirname }}
when:
- not neutron_developer_mode | bool
- neutron_venv_enabled | bool
- neutron_get_venv | success
tags:
@ -193,7 +223,7 @@
with_items: neutron_pip_packages
when:
- neutron_venv_enabled | bool
- neutron_get_venv | failed
- neutron_get_venv | failed or neutron_developer_mode | bool
notify: Restart neutron services
tags:
- neutron-install
@ -209,9 +239,10 @@
retries: 5
delay: 2
with_items: neutron_pip_packages
when: not neutron_venv_enabled | bool
when:
- not neutron_developer_mode | bool
- not neutron_venv_enabled | bool
notify: Restart neutron services
tags:
- neutron-install
- neutron-pip-packages