Force clean yum metadata when repo config changes

When changing the repo URL, the metadata does not reliably
update, resulting in the right URL being used, but the
wrong package list. This is why we force the metadata to be
cleaned out whenever the repo config changes.

Change-Id: I9bca9a89b58cd539dd5c224d6b141dc4d844bcc2
(cherry picked from commit 1da7340a99)
This commit is contained in:
Jesse Pretorius 2017-03-14 15:24:29 +00:00 committed by Jesse Pretorius (odyssey4me)
parent f815c7b30b
commit 8c895ea981
1 changed files with 13 additions and 1 deletions

View File

@ -61,12 +61,24 @@
gpgcheck: yes
enabled: yes
register: add_repos
until: add_repos|success
until: add_repos | success
retries: 5
delay: 2
tags:
- galera-repos
# When changing the repo URL, the metadata does
# not reliably update, resulting in the right
# URL being used, but the wrong package list.
# This is why we force the metadata to be
# cleaned out whenever the repo config changes.
- name: Force the expiry of the repo metadata
command: "yum clean metadata"
when: add_repos | changed
tags:
- galera-repos
- skip_ansible_lint
- name: Install percona repo
yum:
pkg: "{{ galera_percona_xtrabackup_repo.repo }}"