diff --git a/defaults/main.yml b/defaults/main.yml index d0aa4bb..1d82962 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -43,31 +43,18 @@ zun_git_install_branch: master zun_kuryr_git_repo: https://git.openstack.org/openstack/kuryr-libnetwork zun_kuryr_git_install_branch: master -zun_developer_mode: false -zun_developer_constraints: +zun_upper_constraints_url: "{{ requirements_git_url | default('https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=' ~ requirements_git_install_branch | default('master')) }}" +zun_git_constraints: - "git+{{ zun_git_repo }}@{{ zun_git_install_branch }}#egg=zun" - "git+{{ zun_kuryr_git_repo }}@{{ zun_kuryr_git_install_branch }}#egg=kuryr-libnetwork" + - "--constraint {{ zun_upper_constraints_url }}" -# TODO(odyssey4me): -# This can be simplified once all the roles are using -# python_venv_build. We can then switch to using a -# set of constraints in pip.conf inside the venv, -# perhaps prepared by giving a giving a list of -# constraints to the role. -zun_pip_install_args: >- - {{ zun_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }} - {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''), '') }} - {{ pip_install_options | default('') }} +zun_pip_install_args: "{{ pip_install_options | default('') }}" # Name of the virtual env to deploy into zun_venv_tag: "{{ venv_tag | default('untagged') }}" zun_bin: "/openstack/venvs/zun-{{ zun_venv_tag }}/bin" -# venv_download, even when true, will use the fallback method of building the -# venv from scratch if the venv download fails. -zun_venv_download: "{{ not zun_developer_mode | bool }}" -zun_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/zun.tgz - zun_fatal_deprecations: False ## Zun user information diff --git a/tasks/main.yml b/tasks/main.yml index 8be24d6..97773e8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -24,15 +24,27 @@ tags: - always -- include_tasks: zun_pre_flight.yml +- import_tasks: zun_pre_flight.yml tags: - always -- include_tasks: zun_pre_install.yml +- import_tasks: zun_pre_install.yml tags: - zun-install -- include_tasks: zun_install.yml +- name: Install the python venv + include_role: + name: "python_venv_build" + vars: + venv_build_constraints: "{{ zun_git_constraints }}" + venv_install_destination_path: "{{ zun_bin | dirname }}" + venv_install_distro_package_list: "{{ zun_distro_packages }}" + venv_pip_install_args: "{{ zun_pip_install_args }}" + venv_pip_packages: "{{ zun_pip_packages | union((zun_oslomsg_amqp1_enabled | bool) | ternary(zun_optional_oslomsg_amqp1_pip_packages, [])) }}" + venv_facts_when_changed: + - section: "zun" + option: "venv_tag" + value: "{{ zun_venv_tag }}" tags: - zun-install @@ -56,27 +68,27 @@ - common-mq - zun-config -- include_tasks: zun_db_setup.yml +- import_tasks: zun_db_setup.yml when: - "zun_services['zun-api']['group'] in group_names" - "inventory_hostname == ((groups['zun_api'] | intersect(ansible_play_hosts)) | list)[0]" tags: - zun-config -- include_tasks: zun_service_setup.yml +- import_tasks: zun_service_setup.yml when: - "zun_services['zun-api']['group'] in group_names" - "inventory_hostname == ((groups['zun_api'] | intersect(ansible_play_hosts)) | list)[0]" tags: - zun-config -- include_tasks: zun_compute.yml +- import_tasks: zun_compute.yml when: - "zun_services['zun-compute']['group'] in group_names" tags: - zun-compute -- include_tasks: zun_post_install.yml +- import_tasks: zun_post_install.yml tags: - zun-config @@ -108,7 +120,7 @@ - systemd-service - name: Run the etcd service role - include_role: + import_role: name: etcd vars: etcd_cluster_group: "zun_api" diff --git a/tasks/zun_compute.yml b/tasks/zun_compute.yml index 2afaddf..3bf0906 100644 --- a/tasks/zun_compute.yml +++ b/tasks/zun_compute.yml @@ -193,7 +193,7 @@ - name: Ensure docker users are added to the docker group user: name: "{{ item }}" - group: docker + group: "{{ zun_docker_groupname }}" append: yes with_items: "{{ zun_docker_users }}" diff --git a/tasks/zun_install.yml b/tasks/zun_install.yml deleted file mode 100644 index 5a228b5..0000000 --- a/tasks/zun_install.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -# Copyright 2018, Rackspace US, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# TODO(odyssey4me): -# This can be simplified once all the roles are using -# python_venv_build. We can then switch to using a -# set of constraints in pip.conf inside the venv, -# perhaps prepared by giving a giving a list of -# constraints to the role. -- name: Create developer mode constraint file - copy: - dest: "/opt/developer-pip-constraints.txt" - content: | - {% for item in zun_developer_constraints %} - {{ item }} - {% endfor %} - when: - - zun_developer_mode | bool - -- name: Ensure remote wheel building is disabled in developer mode - set_fact: - venv_build_host: "{{ ansible_hostname }}" - when: - - zun_developer_mode | bool - -- name: Install the python venv - include_role: - name: "python_venv_build" - vars: - venv_install_destination_path: "{{ zun_bin | dirname }}" - venv_install_distro_package_list: "{{ zun_distro_packages }}" - venv_pip_install_args: "{{ zun_pip_install_args }}" - venv_pip_packages: "{{ (zun_oslomsg_amqp1_enabled | bool) | ternary(zun_pip_packages + zun_optional_oslomsg_amqp1_pip_packages, zun_pip_packages) }}" - venv_facts_when_changed: - - section: "zun" - option: "venv_tag" - value: "{{ zun_venv_tag }}" diff --git a/tests/test-install-zun.yml b/tests/test-install-zun.yml index 4eb2c10..53314e2 100644 --- a/tests/test-install-zun.yml +++ b/tests/test-install-zun.yml @@ -26,7 +26,6 @@ zun_galera_password: secrete zun_service_password: secrete zun_kuryr_service_password: secrete - zun_developer_mode: true zun_service_publicuri: "http://{{ hostvars[groups['keystone_all'][0]]['ansible_host'] }}:9517" zun_service_adminuri: "http://{{ hostvars[groups['keystone_all'][0]]['ansible_host'] }}:9517" zun_service_internaluri: "http://{{ hostvars[groups['keystone_all'][0]]['ansible_host'] }}:9517" diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml index f6a6f7b..de925fb 100644 --- a/vars/redhat-7.yml +++ b/vars/redhat-7.yml @@ -24,3 +24,5 @@ zun_distro_packages: zun_distro_compute_packages: - docker - pciutils + +zun_docker_groupname: dockerroot diff --git a/vars/suse.yml b/vars/suse.yml index 0b16b13..ebf9e70 100644 --- a/vars/suse.yml +++ b/vars/suse.yml @@ -27,3 +27,5 @@ zun_distro_packages: zun_distro_compute_packages: - docker-ce - pciutils + +zun_docker_groupname: dockerroot diff --git a/vars/ubuntu.yml b/vars/ubuntu.yml index 3ff35a5..06d63d1 100644 --- a/vars/ubuntu.yml +++ b/vars/ubuntu.yml @@ -29,5 +29,7 @@ zun_distro_compute_packages: - docker-ce - pciutils +zun_docker_groupname: docker + ## APT Cache options cache_timeout: 600 diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index fa1bfd7..45c2d46 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -14,19 +14,6 @@ - project: templates: - - check-requirements + - openstack-ansible-role-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 - check: - jobs: - - openstack-ansible-linters - - openstack-ansible-functional-ubuntu-xenial - - openstack-ansible-functional-ubuntu-bionic - experimental: - jobs: - - openstack-ansible-integrated-deploy-aio - gate: - jobs: - - openstack-ansible-linters - - openstack-ansible-functional-ubuntu-xenial - - openstack-ansible-functional-ubuntu-bionic