---
# Copyright 2017, SUSE LINUX GmbH.
#
# 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.

_galera_opensuse_dir: "{{ (ansible_distribution_major_version == '15') | ternary(ansible_distribution_version | regex_replace('\\.', ''), ansible_distribution_major_version) }}"
_galera_client_repo_url: "http://{{ galera_repo_host }}/MariaDB/mariadb-{{ galera_client_major_version }}.{{ galera_client_minor_version }}/yum/opensuse{{ _galera_opensuse_dir }}-amd64"
_galera_client_repo:
  name: MariaDB
  description: "MariaDB Repo"
  baseurl: "{{ galera_client_repo_url }}"

galera_client_distro_packages:
  - MariaDB-client

# Galera GPG Keys
_galera_client_gpg_keys:
  - key: /etc/pki/RPM-GPG-KEY-MariaDB

---
# Copyright 2017, SUSE LINUX GmbH.
#
# 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.

_galera_opensuse_dir: "{{ ansible_distribution_major_version }}"
_galera_client_repo_url: "http://{{ galera_repo_host }}/MariaDB/mariadb-{{ galera_client_major_version }}.{{ galera_client_minor_version }}/yum/opensuse{{ _galera_opensuse_dir }}-amd64"
_galera_client_repo:
  name: MariaDB
  description: "MariaDB Repo"
  baseurl: "{{ galera_client_repo_url }}"

galera_client_distro_packages:
  - MariaDB-client

# Galera GPG Keys
_galera_client_gpg_keys:
  - key: /etc/pki/RPM-GPG-KEY-MariaDB

Fix galera_client installation for openSUSE Leap 15.1
Fix galera_client installation for openSUSE Leap 15.1

The MariaDB repositories are offering a download repo under
the leap major version, e.g. "opensuse15" or "opensuse42" for all leap
42.x and leap 15.x versions, respectively. There isn't a specific
build for openSUSE Leap 15.1, so the previous logic selected
a repo url of opensuse-151 which does not exist.

Change-Id: I64c6796e4324717dd98aa8488bc3e83b31073c45
