diff --git a/playbooks/manual/staging-sync/lookaside-include.yml b/playbooks/manual/staging-sync/lookaside-include.yml new file mode 100644 index 0000000000..0d34bb3838 --- /dev/null +++ b/playbooks/manual/staging-sync/lookaside-include.yml @@ -0,0 +1,61 @@ +# This playbook syncs a *subset* of the production lookaside cache to stg. +# bochecha asked for this in 2015 -- implemented by ralph. +# +# Adjust in 2016 to copy specific sets of packages. See lookaside.yml for that. + + +- name: tar up a subset of the prod lookaside cache + hosts: pkgs + user: root + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + vars: + tarball: /var/tmp/prod-lookaside-subset.tar.xz + intermediary: /var/tmp/prod-lookaside + target: /srv/cache/lookaside/pkgs + + + tasks: + - shell: tar -cJvf {{tarball}} {{target}}/{{packages}} + creates={{tarball}} + - fetch: src={{tarball}} + dest={{intermediary}} + fail_on_missing=yes + +- name: copy and expand that subset to staging lookaside + hosts: pkgs-stg + user: root + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + vars: + tarball: /var/tmp/prod-lookaside-subset.tar.xz + intermediary: /var/tmp/prod-lookaside + target: /srv/cache/lookaside/pkgs + + tasks: + - unarchive: src={{intermediary}}/pkgs02.phx2.fedoraproject.org/{{tarball}} dest=/ + +- name: finish cleaning up after ourselves + hosts: batcave01.phx2.fedoraproject.org:pkgs:pkgs-stg + user: root + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + vars: + tarball: /var/tmp/prod-lookaside-subset.tar.xz + intermediary: /var/tmp/prod-lookaside + target: /srv/cache/lookaside/pkgs + + tasks: + - file: dest={{intermediary}} state=absent + tags: cleanup + - file: dest={{tarball}} state=absent + tags: cleanup diff --git a/playbooks/manual/staging-sync/lookaside.yml b/playbooks/manual/staging-sync/lookaside.yml index 2005b9b991..fdcaa907f8 100644 --- a/playbooks/manual/staging-sync/lookaside.yml +++ b/playbooks/manual/staging-sync/lookaside.yml @@ -1,61 +1,7 @@ -# This playbook syncs a *subset* of the production lookaside cache to stg. -# bochecha asked for this in 2015 -- implemented by ralph. -# -# Presently, we only do the packages that start with 'a', because there's just -# too much data otherwise. +# Run staging sync for lookaside on a couple different package sets. - -- name: tar up a subset of the prod lookaside cache - hosts: pkgs - user: root - vars_files: - - /srv/web/infra/ansible/vars/global.yml - - "/srv/private/ansible/vars.yml" - - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml - - vars: - tarball: /var/tmp/prod-lookaside-subset.tar.xz - intermediary: /var/tmp/prod-lookaside - target: /srv/cache/lookaside/pkgs - - tasks: - - shell: tar -cJvf {{tarball}} {{target}}/ad* {{target}}/bash - creates={{tarball}} - - fetch: src={{tarball}} - dest={{intermediary}} - fail_on_missing=yes - -- name: copy and expand that subset to staging lookaside - hosts: pkgs-stg - user: root - vars_files: - - /srv/web/infra/ansible/vars/global.yml - - "/srv/private/ansible/vars.yml" - - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml - - vars: - tarball: /var/tmp/prod-lookaside-subset.tar.xz - intermediary: /var/tmp/prod-lookaside - target: /srv/cache/lookaside/pkgs - - tasks: - - unarchive: src={{intermediary}}/pkgs02.phx2.fedoraproject.org/{{tarball}} dest=/ - -- name: finish cleaning up after ourselves - hosts: batcave01.phx2.fedoraproject.org:pkgs:pkgs-stg - user: root - vars_files: - - /srv/web/infra/ansible/vars/global.yml - - "/srv/private/ansible/vars.yml" - - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml - - vars: - tarball: /var/tmp/prod-lookaside-subset.tar.xz - intermediary: /var/tmp/prod-lookaside - target: /srv/cache/lookaside/pkgs - - tasks: - - file: dest={{intermediary}} state=absent - tags: cleanup - - file: dest={{tarball}} state=absent - tags: cleanup +- include: /srv/web/infra/ansible/playbooks/manual/staging-sync/lookaside-include.yml packages="{audit,basesystem,bash,coreutils,cronie,curl,dhcp,dnf,e2fsprogs,filesystem}" +- include: /srv/web/infra/ansible/playbooks/manual/staging-sync/lookaside-include.yml packages="{glibc,grubby,hostname,httpd,initscripts,iproute,iputils,kbd,less,man-db}" +- include: /srv/web/infra/ansible/playbooks/manual/staging-sync/lookaside-include.yml packages="{mariadb,ncurses,openssh,parted,passwd,php,plymouth,policycoreutils,procps-ng}" +- include: /srv/web/infra/ansible/playbooks/manual/staging-sync/lookaside-include.yml packages="{rootfiles,rpm,selinux-policy,setup,shadow-utils,sudo,systemd,uboot-tools}" +- include: /srv/web/infra/ansible/playbooks/manual/staging-sync/lookaside-include.yml packages="{util-linux,vim}"