From 15129b81fdf76edd2550d3bcf3f0487458b39f6c Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Tue, 16 Apr 2019 18:04:15 +0000 Subject: [PATCH] mirrorlist_proxy: Add a seperate check for mirrorlist cache files Since we delegate the command, we can't test the cache files, since the creates is looking on mm-backend01, not the proxies. So instead we stat the cache files and only run the command if they don't exist. Signed-off-by: Kevin Fenzi --- roles/mirrormanager/mirrorlist_proxy/tasks/main.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/roles/mirrormanager/mirrorlist_proxy/tasks/main.yml b/roles/mirrormanager/mirrorlist_proxy/tasks/main.yml index 9382bbf3ad..444c1862eb 100644 --- a/roles/mirrormanager/mirrorlist_proxy/tasks/main.yml +++ b/roles/mirrormanager/mirrorlist_proxy/tasks/main.yml @@ -135,13 +135,15 @@ - selinux - mirrorlist_proxy +- name: check for mirrorlist files + stat: path=/srv/mirrorlist/data/mirrorlist1/mirrorlist_cache.pkl + register: mirrorlist_cache_status + - name: Deploy mirrorlist data files (if this is a initial install) command: "rsync -az --delete-delay --delay-updates --delete /var/lib/mirrormanager/mirrorlist_cache.pkl /var/lib/mirrormanager/global_netblocks.txt /var/lib/mirrormanager/i2_netblocks.txt {{ inventory_hostname }}:/srv/mirrorlist/data/mirrorlist1/" - args: - creates: /srv/mirrorlist/data/mirrorlist1/mirrorlist_cache.pkl become: yes become_user: mirrormanager delegate_to: "mm-backend01.phx2.fedoraproject.org" - when: env == "production" + when: env == "production" and not mirrorlist_cache_status.stat.exists tags: - mirrorlist_proxy