Allow override of the repo filename

Apt cannot have 2 mirrors with the same content in 2 different files.
If a deployer has an apt mirror with mariadb (and others), the deployer
still need to add a repository, but will also need to define the
filename used, in order to avoid clashes.

This commit makes possible to decide the filename for the repo.

Change-Id: Ic83d464512f6f8697e520d79520dcf21370f8beb
Signed-off-by: Jean-Philippe Evrard <jean-philippe.evrard@rackspace.co.uk>
This commit is contained in:
Jean-Philippe Evrard 2017-01-03 11:41:18 +00:00
parent 8fd03f2f41
commit 8935c29e70
4 changed files with 9 additions and 3 deletions

View File

@ -37,3 +37,5 @@ galera_client_fatal_deprecations: false
## Tunable overrides
galera_client_my_cnf_overrides: {}
mariadb_repo_filename: "MariaDB"

View File

@ -0,0 +1,4 @@
---
features:
- The filename of the apt/yum source can now be
defined with the variable ``mariadb_repo_filename``.

View File

@ -58,7 +58,7 @@
# statically named apt sources file.
- name: Find old sources
command: >
grep -rnil maria /etc/apt/sources.list.d/ --exclude MariaDB.list
grep -rnil maria /etc/apt/sources.list.d/ --exclude {{ mariadb_repo_filename }}.list
changed_when: false
failed_when: false
register: old_sources
@ -84,7 +84,7 @@
- name: Add galera repo
apt_repository:
repo: "{{ galera_client_repo }}"
filename: MariaDB
filename: "{{ mariadb_repo_filename }}"
state: present
update_cache: yes
register: add_repo

View File

@ -18,7 +18,7 @@ galera_client_repo:
state: "present"
name: MariaDB
description: "MariaDB Repo"
file: MariaDB
file: "{{ mariadb_repo_filename }}"
baseurl: "{{ galera_client_yum_repo_url }}"
gpgkey: "http://yum.mariadb.org/RPM-GPG-KEY-MariaDB"