From 4c0e883ce08e460bb6f4c07aa8940bfbbd3464f9 Mon Sep 17 00:00:00 2001 From: Ricky Elrod Date: Tue, 15 May 2018 22:47:22 +0000 Subject: [PATCH] Add a playbook to sync the old pkl out Signed-off-by: Ricky Elrod --- playbooks/manual/sync-old-pkl.yml | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 playbooks/manual/sync-old-pkl.yml diff --git a/playbooks/manual/sync-old-pkl.yml b/playbooks/manual/sync-old-pkl.yml new file mode 100644 index 0000000000..124a78f952 --- /dev/null +++ b/playbooks/manual/sync-old-pkl.yml @@ -0,0 +1,39 @@ +- name: Do mm-backend stuff + hosts: mm-backend01.phx2.fedoraproject.org + + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + tasks: + - name: Copy borked pkl + copy: src=/var/lib/mirrormanager/mirrorlist_cache.pkl dest=/root/mirrorlist_cache.pkl-{{ ansible_date_time.date }} + + - name: Nuke borked pkl + file: path=/var/lib/mirrormanager/mirrorlist_cache.pkl state=absent + + - name: Copy old pkl/files into place + copy: src=/var/lib/mirrormanager/old/{{item}} dest=/var/lib/mirrormanager/{{item}} force=yes + with_items: + - mirrorlist_cache.pkl + - i2_netblocks.txt + - global_netblocks.txt + + - name: Sync the pkl + command: /usr/local/bin/sync_pkl_to_mirrorlists.sh + +- name: Do mm-proxy stuff + hosts: mirrorlist-proxies + + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + tasks: + - name: Restart mirrorlist1 + command: systemctl restart mirrorlist1 + + - name: Stop mirrorlist2 + command: systemctl stop mirrorlist2