From 9116768e2af940e9de3daff9a4388cd771707f79 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Tue, 9 Mar 2021 12:33:44 -0800 Subject: [PATCH] sundries and proxies / staging: switch to new flatpak-indexer Under the old setup, we ran 'reg' on sundries and then synced that content (in 3 rsyncs) to proxies. With this new setup, flatpak-indexer runs in openshift. It has a nfs volume where it writes it's output too. We rsync just that entire output directory to the proxies. This includes things like deltas. This commit should only affect staging, we will roll to production later. Signed-off-by: Kevin Fenzi --- playbooks/groups/sundries.yml | 7 ++++- .../files/cron-sync-registry-signatures | 1 - roles/fedora-web/registry/tasks/main.yml | 26 +------------------ .../cron-sync-registry-index | 2 ++ roles/rsyncd/files/rsyncd.conf.sundries-stg | 2 +- 5 files changed, 10 insertions(+), 28 deletions(-) delete mode 100644 roles/fedora-web/registry/files/cron-sync-registry-signatures rename roles/fedora-web/registry/{files => templates}/cron-sync-registry-index (90%) diff --git a/playbooks/groups/sundries.yml b/playbooks/groups/sundries.yml index c4f70c4d8f..e27c115bf8 100644 --- a/playbooks/groups/sundries.yml +++ b/playbooks/groups/sundries.yml @@ -29,7 +29,7 @@ - role: easyfix/gather when: master_sundries_node|bool - role: regindexer/build - when: master_sundries_node|bool + when: master_sundries_node|bool and env != "staging" - role: bz_review_report when: master_sundries_node|bool and env != "staging" - rsyncd @@ -69,6 +69,11 @@ mnt_dir: '/srv/web/review-stats' nfs_src_dir: 'openshift_{{ env_short }}_reviewstats' mount_stg: true + - role: nfs/client + mnt_dir: '/srv/web/registry-index' + nfs_src_dir: '/flatpak-indexer-storage{{ env_short }}' + mount_stg: true + pre_tasks: - import_tasks: "{{ tasks_path }}/yumrepos.yml" diff --git a/roles/fedora-web/registry/files/cron-sync-registry-signatures b/roles/fedora-web/registry/files/cron-sync-registry-signatures deleted file mode 100644 index 7956c9a415..0000000000 --- a/roles/fedora-web/registry/files/cron-sync-registry-signatures +++ /dev/null @@ -1 +0,0 @@ -30 * * * * root /usr/bin/rsync --delete -a --no-owner --no-group sundries01::registry-signatures/ /srv/web/registry-signatures/ diff --git a/roles/fedora-web/registry/tasks/main.yml b/roles/fedora-web/registry/tasks/main.yml index d8756bdc23..c5895990e4 100644 --- a/roles/fedora-web/registry/tasks/main.yml +++ b/roles/fedora-web/registry/tasks/main.yml @@ -4,18 +4,6 @@ - fedora-web when: env != 'staging' -- name: make registry-signatures dir - file: state=directory path=/srv/web/registry-signatures owner=apache group=apache mode=2775 setype=httpd_sys_content_t seuser=system_u - tags: - - fedora-web - when: env == 'staging' - -- name: make registry-index dir - file: state=directory path=/srv/web/registry-index owner=apache group=sysadmin-releng mode=755 setype=httpd_sys_content_t seuser=system_u - tags: - - fedora-web - when: env != 'staging' - - name: make registry-index dir file: state=directory path=/srv/web/registry-index owner=apache group=apache mode=755 setype=httpd_sys_content_t seuser=system_u tags: @@ -31,20 +19,8 @@ - fedora-web - fedora-web/registry -#- name: Copy in the sync-registry-signatures cronjob -# copy: src=cron-sync-registry-signatures dest=/etc/cron.d/sync-registry-signatures -# tags: -# - fedora-web -# - fedora-web/registry - -- name: Temporarily disable the registry-signatures cronjob - file: path=/etc/cron.d/sync-registry-signatures state=absent - tags: - - fedora-web - - fedora-web/registry - - name: Copy in the sync-registry-index cronjob - copy: src=cron-sync-registry-index dest=/etc/cron.d/sync-registry-index + template: src=cron-sync-registry-index dest=/etc/cron.d/sync-registry-index tags: - fedora-web - fedora-web/registry diff --git a/roles/fedora-web/registry/files/cron-sync-registry-index b/roles/fedora-web/registry/templates/cron-sync-registry-index similarity index 90% rename from roles/fedora-web/registry/files/cron-sync-registry-index rename to roles/fedora-web/registry/templates/cron-sync-registry-index index 2c73156c7b..1862bc6b44 100644 --- a/roles/fedora-web/registry/files/cron-sync-registry-index +++ b/roles/fedora-web/registry/templates/cron-sync-registry-index @@ -1,3 +1,5 @@ 30 * * * * root /usr/bin/rsync -a --no-owner --no-group sundries01::registry-index/ /srv/web/registry-index/ +{% if env != 'staging' %} 31 * * * * root /usr/bin/rsync --delete -a --no-owner --no-group sundries01::regindexer/index/ /srv/web/registry-index/index/ 32 * * * * root /usr/bin/rsync --delete -a --no-owner --no-group sundries01::regindexer/icons/ /srv/web/registry-index/icons/ +{% endif %} diff --git a/roles/rsyncd/files/rsyncd.conf.sundries-stg b/roles/rsyncd/files/rsyncd.conf.sundries-stg index 05d1f33cb8..b1265f0bfb 100644 --- a/roles/rsyncd/files/rsyncd.conf.sundries-stg +++ b/roles/rsyncd/files/rsyncd.conf.sundries-stg @@ -192,7 +192,7 @@ hosts allow = 10.5.126.0/255.255.255.0 192.168.0.0/255.255.0.0 10.5.128.0/255.25 [registry-index] comment = registry-index -path = /var/lib/reg-server/static/ +path = /srv/web/registry-index uid = root gid = root read only = yes