From 8935c29e70706518b143da33b41d2b3ef9368a54 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Tue, 3 Jan 2017 11:41:18 +0000 Subject: [PATCH] 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 --- defaults/main.yml | 2 ++ releasenotes/notes/apt-source-filenamed-9718897bcfa7b36b.yaml | 4 ++++ tasks/galera_client_install_apt.yml | 4 ++-- vars/redhat-7.yml | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/apt-source-filenamed-9718897bcfa7b36b.yaml diff --git a/defaults/main.yml b/defaults/main.yml index 9a075ae..30a3018 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -37,3 +37,5 @@ galera_client_fatal_deprecations: false ## Tunable overrides galera_client_my_cnf_overrides: {} + +mariadb_repo_filename: "MariaDB" \ No newline at end of file diff --git a/releasenotes/notes/apt-source-filenamed-9718897bcfa7b36b.yaml b/releasenotes/notes/apt-source-filenamed-9718897bcfa7b36b.yaml new file mode 100644 index 0000000..641ed44 --- /dev/null +++ b/releasenotes/notes/apt-source-filenamed-9718897bcfa7b36b.yaml @@ -0,0 +1,4 @@ +--- +features: + - The filename of the apt/yum source can now be + defined with the variable ``mariadb_repo_filename``. diff --git a/tasks/galera_client_install_apt.yml b/tasks/galera_client_install_apt.yml index 5b9e71e..59f771a 100644 --- a/tasks/galera_client_install_apt.yml +++ b/tasks/galera_client_install_apt.yml @@ -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 diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml index 28930da..54c451e 100644 --- a/vars/redhat-7.yml +++ b/vars/redhat-7.yml @@ -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"