diff --git a/defaults/main.yml b/defaults/main.yml index d1664a45..41bba9b2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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" diff --git a/meta/main.yml b/meta/main.yml index 91cc7231..c4f2a15a 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -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 diff --git a/tasks/neutron_install.yml b/tasks/neutron_install.yml index 1c458d6d..beac8d81 100644 --- a/tasks/neutron_install.yml +++ b/tasks/neutron_install.yml @@ -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 -