Skip to content

Commit

Permalink
Set a var for the MariaDB major version
Browse files Browse the repository at this point in the history
Setting a custom MariaDB mirror URL is very tedious to maintain
because operators must ensure they update the overridden repo
URL every time the major version changes within the galera role.

This will allow operators to set overrides for their local mirror
like:

galera_repo_url: "http://mirror.mydomain.com/mariadb/repo/{{ galera_major_version }}/ubuntu"

Change-Id: Ie5dd27b8cffff5245724ecc79e79272086bf3b30
(cherry picked from commit 039ece9)
  • Loading branch information
logan2211 committed Sep 17, 2017
1 parent 9a33c61 commit 0b4c0f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions defaults/main.yml
Expand Up @@ -43,6 +43,9 @@ galera_debconf_items: []
galera_server_percona_distro_packages: []
galera_mariadb_server_package: "{{ _galera_mariadb_server_package }}"

# The major version used to select the repo URL path
galera_major_version: 10.1

# Set the URL for the MariaDB repository
galera_repo_url: "{{ _galera_repo_url }}"

Expand Down
2 changes: 1 addition & 1 deletion vars/redhat-7.yml
Expand Up @@ -44,7 +44,7 @@ galera_server_upgrade_packages_remove:
- MariaDB-Galera-server
- MariaDB-server

_galera_repo_url: "http://yum.mariadb.org/10.1/centos/7/x86_64"
_galera_repo_url: "http://yum.mariadb.org/{{ galera_major_version }}/centos/7/x86_64"
_galera_repo:
name: MariaDB
description: "MariaDB Repo"
Expand Down
4 changes: 2 additions & 2 deletions vars/ubuntu-16.04.yml
Expand Up @@ -42,7 +42,7 @@ galera_server_required_distro_packages:
# The package name for mariaDB is set as a variable
# so that it can be used in debconf later in the
# "galera_common" role.
_galera_mariadb_server_package: "mariadb-server-10.1"
_galera_mariadb_server_package: "mariadb-server-{{ galera_major_version }}"

# NB This is specifically galera_server_mariadb_distro_packages as these
# packages only get installed during the galera play - this is because of
Expand Down Expand Up @@ -96,7 +96,7 @@ _galera_percona_xtrabackup_repo:
state: "present"
filename: "Percona"

_galera_repo_url: "http://mirror.rackspace.com/mariadb/repo/10.1/ubuntu"
_galera_repo_url: "http://mirror.rackspace.com/mariadb/repo/{{ galera_major_version }}/ubuntu"
_galera_repo:
repo: "deb {{ galera_repo_url }} {{ ansible_distribution_release }} main"
state: "present"
Expand Down

0 comments on commit 0b4c0f4

Please sign in to comment.