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
This commit is contained in:
Jesse Pretorius 2017-03-14 15:24:29 +00:00
parent cf1f8f3cac
commit 1da7340a99

@ -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 }}"