Add support for openSUSE

This patch aims to ensure that this role is functional in
opensuse distros.

Change-Id: I153ba0b5ba3b56f70d223f7e472e6213be146f27
This commit is contained in:
kaiokassiano 2018-08-03 11:27:48 -03:00
parent 9fc6ee6cb8
commit e7c468ed84
6 changed files with 68 additions and 7 deletions

View File

@ -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"

View File

@ -29,6 +29,9 @@ galaxy_info:
versions:
- xenial
- bionic
- name: opensuse
versions:
- all
categories:
- cloud
- python

View File

@ -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 }}"

View File

@ -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 }}"

31
vars/suse.yml Normal file
View File

@ -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

View File

@ -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