Enable developer mode
This commit adds the ability to install cinder 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: I85ba753a946b22ee3e9b9403977501a1804f9d86 Partial-Bug: #1553967
This commit is contained in:
parent
5bb3ab739a
commit
17c7c08f29
@ -21,6 +21,12 @@ debug: False
|
||||
verbose: True
|
||||
cache_timeout: 600
|
||||
|
||||
swift_git_repo: https://git.openstack.org/openstack/swift
|
||||
swift_git_install_branch: master
|
||||
swift_developer_mode: false
|
||||
swift_developer_constraints:
|
||||
- "git+{{ swift_git_repo }}@{{ swift_git_install_branch }}#egg=swift"
|
||||
|
||||
# Name of the virtual env to deploy into
|
||||
swift_venv_tag: untagged
|
||||
swift_venv_bin: "/openstack/venvs/swift-{{ swift_venv_tag }}/bin"
|
||||
|
@ -32,4 +32,6 @@ galaxy_info:
|
||||
dependencies:
|
||||
- apt_package_pinning
|
||||
- openstack_openrc
|
||||
- pip_lock_down
|
||||
- role: pip_lock_down
|
||||
when:
|
||||
- not swift_developer_mode | bool
|
||||
|
@ -43,6 +43,28 @@
|
||||
- swift-install
|
||||
- swift-apt-packages
|
||||
|
||||
- name: Create developer mode constraint file
|
||||
copy:
|
||||
dest: "/opt/developer-pip-constraints.txt"
|
||||
content: |
|
||||
{% for item in swift_developer_constraints %}
|
||||
{{ item }}
|
||||
{% endfor %}
|
||||
when:
|
||||
- swift_developer_mode | bool
|
||||
tags:
|
||||
- swift-install
|
||||
- swift-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:
|
||||
- swift_developer_mode | bool
|
||||
tags:
|
||||
- swift-install
|
||||
- swift-pip-packages
|
||||
|
||||
- name: Install requires pip packages
|
||||
pip:
|
||||
name: "{{ item }}"
|
||||
@ -61,7 +83,9 @@
|
||||
stat:
|
||||
path: "/var/cache/{{ swift_venv_download_url | basename }}"
|
||||
get_md5: False
|
||||
when: swift_venv_enabled | bool
|
||||
when:
|
||||
- swift_venv_enabled | bool
|
||||
- not swift_developer_mode | bool
|
||||
register: local_venv_stat
|
||||
tags:
|
||||
- swift-install
|
||||
@ -71,7 +95,9 @@
|
||||
uri:
|
||||
url: "{{ swift_venv_download_url | replace('tgz', 'checksum') }}"
|
||||
return_content: True
|
||||
when: swift_venv_enabled | bool
|
||||
when:
|
||||
- swift_venv_enabled | bool
|
||||
- not swift_developer_mode | bool
|
||||
register: remote_venv_checksum
|
||||
tags:
|
||||
- swift-install
|
||||
@ -90,6 +116,7 @@
|
||||
ignore_errors: true
|
||||
register: get_venv
|
||||
when:
|
||||
- not swift_developer_mode | bool
|
||||
- swift_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: "{{ swift_venv_bin | dirname }}"
|
||||
state: directory
|
||||
when:
|
||||
- not swift_developer_mode | bool
|
||||
- swift_venv_enabled | bool
|
||||
- swift_get_venv | changed
|
||||
tags:
|
||||
@ -135,6 +163,7 @@
|
||||
when:
|
||||
- swift_venv_enabled | bool
|
||||
- swift_get_venv | changed
|
||||
- not swift_developer_mode | bool
|
||||
notify:
|
||||
- Restart swift account services
|
||||
- Restart swift container services
|
||||
@ -150,6 +179,7 @@
|
||||
when:
|
||||
- swift_venv_enabled | bool
|
||||
- swift_get_venv | success
|
||||
- not swift_developer_mode | bool
|
||||
tags:
|
||||
- swift-install
|
||||
- swift-pip-packages
|
||||
@ -169,6 +199,7 @@
|
||||
when:
|
||||
- swift_venv_enabled | bool
|
||||
- swift_get_venv | failed
|
||||
- not swift_developer_mode | bool
|
||||
notify:
|
||||
- Restart swift account services
|
||||
- Restart swift container services
|
||||
@ -188,7 +219,9 @@
|
||||
retries: 5
|
||||
delay: 2
|
||||
with_items: swift_pip_packages
|
||||
when: not swift_venv_enabled | bool
|
||||
when:
|
||||
- not swift_venv_enabled | bool
|
||||
- not swift_developer_mode | bool
|
||||
notify:
|
||||
- Restart swift account services
|
||||
- Restart swift container services
|
||||
|
Loading…
Reference in New Issue
Block a user