Tidy yum repository setup
Clear repo metadata after adding both galera and percona repos rather than only after galera, and pass priority directly to yum_repository ansible module. Change-Id: I88c7e16901d2b5dffae31772b655b4a7820cf73a
This commit is contained in:
parent
6fdecd17b8
commit
26d546fe8b
@ -109,8 +109,23 @@
|
||||
gpgkey: "{{ galera_repo.gpgkey | default(omit) }}"
|
||||
gpgcheck: yes
|
||||
enabled: yes
|
||||
register: add_repos
|
||||
until: add_repos is success
|
||||
priority: 25
|
||||
register: add_galera_repos
|
||||
until: add_galera_repos is success
|
||||
retries: 5
|
||||
delay: 2
|
||||
|
||||
- name: Install percona repo
|
||||
yum_repository:
|
||||
name: 'percona-release-$basearch'
|
||||
description: 'Percona-Release YUM repository - $basearch'
|
||||
baseurl: "{{ galera_percona_xtrabackup_repo.repo }}"
|
||||
enabled: true
|
||||
gpgcheck: true
|
||||
state: "{{ galera_percona_xtrabackup_repo.state }}"
|
||||
priority: 25
|
||||
register: add_percona_repos
|
||||
until: add_percona_repos is success
|
||||
retries: 5
|
||||
delay: 2
|
||||
|
||||
@ -123,37 +138,10 @@
|
||||
command: "{{ ansible_pkg_mgr }} clean metadata"
|
||||
args:
|
||||
warn: no
|
||||
when: add_repos is changed
|
||||
when: (add_galera_repos is changed) or (add_percona_repos is changed)
|
||||
tags:
|
||||
- skip_ansible_lint
|
||||
|
||||
- name: Install percona repo
|
||||
yum_repository:
|
||||
name: 'percona-release-$basearch'
|
||||
description: 'Percona-Release YUM repository - $basearch'
|
||||
baseurl: "{{ galera_percona_xtrabackup_repo.repo }}"
|
||||
enabled: true
|
||||
gpgcheck: true
|
||||
state: "{{ galera_percona_xtrabackup_repo.state }}"
|
||||
register: install_packages
|
||||
until: install_packages is success
|
||||
retries: 5
|
||||
delay: 2
|
||||
|
||||
# NOTE(mhayden): MariaDB/percona repositories are prioritized at 99 by default
|
||||
# and that allows yum to install galera from the RDO repos, which is not good.
|
||||
# This task ensures that the following task will choose MariaDB/percona repos
|
||||
# as the highest priority.
|
||||
- name: Ensure MariaDB/percona repositories take highest priority
|
||||
command: |
|
||||
yum-config-manager
|
||||
--enable {{ item }}
|
||||
--setopt="{{ item }}.priority=25"
|
||||
with_items:
|
||||
- MariaDB
|
||||
- percona-release-noarch
|
||||
- percona-release-x86_64
|
||||
|
||||
- name: Install galera_server role remote packages
|
||||
package:
|
||||
name: "{{ galera_packages_list }}"
|
||||
|
Loading…
Reference in New Issue
Block a user