diff --git a/defaults/main.yml b/defaults/main.yml index d7b7b62..555de1e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -24,9 +24,10 @@ debug: False # clouds.yaml properly configured. monasca_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}" -# Set the package install state for distribution and pip packages +# Set the package/pattern install state for distribution and pip packages # Options are 'present' and 'latest' monasca_package_state: "latest" +monasca_pattern_state: "latest" monasca_pip_package_state: "latest" monasca_developer_mode: false @@ -331,3 +332,4 @@ monasca_persister_logging_config_overrides: {} monasca_thresh_config_overrides: {} monasca_notification_config_overrides: {} +monasca_opensuse_mirror_url: "http://download.opensuse.org" diff --git a/meta/main.yml b/meta/main.yml index bdd6b47..71dc071 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -29,6 +29,9 @@ galaxy_info: versions: - xenial - bionic + - name: opensuse + versions: + - all categories: - cloud - python diff --git a/tasks/monasca_install.yml b/tasks/monasca_install.yml index 1339166..3543695 100644 --- a/tasks/monasca_install.yml +++ b/tasks/monasca_install.yml @@ -32,6 +32,20 @@ when: - monasca_developer_mode | bool +# TODO(kaiokmo): +# Simplify the install of distro patterns for openSUSE +# using python_venv_build approach. +- name: Install distro patterns (openSUSE) + zypper: + name: "{{ monasca_distro_patterns }}" + state: "{{ monasca_pattern_state }}" + type: pattern + register: install_patterns + until: install_patterns is success + retries: 5 + delay: 2 + when: ansible_pkg_mgr == 'zypper' + - name: Ensure remote wheel building is disabled in developer mode set_fact: venv_build_host: "{{ ansible_hostname }}" diff --git a/tasks/monasca_pre_install.yml b/tasks/monasca_pre_install.yml index a5361a5..f9dc00e 100644 --- a/tasks/monasca_pre_install.yml +++ b/tasks/monasca_pre_install.yml @@ -60,3 +60,13 @@ group: "{{ monasca_system_group_name }}" mode: "0755" when: log_dir.rc != 0 + +- name: Add zypper maven repository + zypper_repository: + auto_import_keys: yes + autorefresh: yes + name: "{{ item.name }}" + repo: "{{ item.uri }}" + runrefresh: yes + when: ansible_pkg_mgr == 'zypper' + with_items: "{{ monasca_external_repo }}" diff --git a/vars/suse.yml b/vars/suse.yml new file mode 100644 index 0000000..3e4793c --- /dev/null +++ b/vars/suse.yml @@ -0,0 +1,31 @@ +--- +# 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. + +# Note (kaiokmo): +# Maven is needed by monasca to build and run. This external repo includes maven, +# since it's not included by default in any openSUSE repos. +# Refer to https://software.opensuse.org/package/maven +monasca_external_repo: + - name: "devel-tools-building" + uri: "{{ monasca_opensuse_mirror_url }}/repositories/devel:/tools:/building/openSUSE_Leap_{{ ansible_distribution_version }}/" + +monasca_distro_packages: + - git-core + - mailx + - maven + - python-devel + - python-MySQL-python + - python-pip + +monasca_distro_patterns: + - devel_basis diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 25bbf1e..2f4141f 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -15,15 +15,16 @@ - 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 + # TODO(kaiokmo): Remove this once centos-7 patch is done + - openstack-ansible-functional-centos-7: + voting: false gate: jobs: - - openstack-ansible-linters - - openstack-ansible-functional-ubuntu-xenial - - openstack-ansible-functional-ubuntu-bionic + # TODO(kaiokmo): Remove this once centos-7 patch is done + - openstack-ansible-functional-centos-7: + voting: false