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 <kevin@scrye.com>
This commit is contained in:
Kevin Fenzi 2019-04-16 18:04:15 +00:00
parent 1e9710de6c
commit 15129b81fd

View file

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