From e5533b2f3dfd11d6c1efecf42a6d2222e21e17c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Wed, 29 May 2024 16:43:11 +0200 Subject: [PATCH] Mirrormanager: specify the SSH key for the sync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- .../mirrormanager/templates/cron-mirrorlist-cache.yml | 4 ++-- .../mirrormanager/templates/update-mirrorlist-cache.sh | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/roles/openshift-apps/mirrormanager/templates/cron-mirrorlist-cache.yml b/roles/openshift-apps/mirrormanager/templates/cron-mirrorlist-cache.yml index 024048b0b7..d3e04fd2c0 100644 --- a/roles/openshift-apps/mirrormanager/templates/cron-mirrorlist-cache.yml +++ b/roles/openshift-apps/mirrormanager/templates/cron-mirrorlist-cache.yml @@ -66,7 +66,7 @@ spec: containers: - name: mirrormanager image: image-registry.openshift-image-registry.svc:5000/mirrormanager/mirrormanager2:latest - command: ["mm2_get-netblocks", "global", "/data/global_netblocks.txt"] + command: ["mm2_get-netblocks", "--debug", "global", "/data/global_netblocks.txt"] volumeMounts: - name: config mountPath: "/etc/mirrormanager" @@ -105,7 +105,7 @@ spec: containers: - name: mirrormanager image: image-registry.openshift-image-registry.svc:5000/mirrormanager/mirrormanager2:latest - command: ["mm2_get-netblocks", "internet2", "/data/i2_netblocks.txt"] + command: ["mm2_get-netblocks", "--debug", "internet2", "/data/i2_netblocks.txt"] volumeMounts: - name: config mountPath: "/etc/mirrormanager" diff --git a/roles/openshift-apps/mirrormanager/templates/update-mirrorlist-cache.sh b/roles/openshift-apps/mirrormanager/templates/update-mirrorlist-cache.sh index d77c614c06..9005e1d340 100644 --- a/roles/openshift-apps/mirrormanager/templates/update-mirrorlist-cache.sh +++ b/roles/openshift-apps/mirrormanager/templates/update-mirrorlist-cache.sh @@ -1,7 +1,9 @@ #!/bin/bash MIRRORLIST_PROXY="{% for host in groups['mirrorlist_proxies'] %} {{ host }} {% endfor %}" +MM_USER=mirrormanager MM_ROOT=/opt/app-root +MM_SSH_KEY=/etc/mirrormanager-ssh/ssh_mirrorlist_proxies.key CACHEDIR=/data set -e @@ -20,9 +22,10 @@ ${MM_ROOT}/bin/generate-mirrorlist-cache -o ${CACHEDIR}/mirrorlist_cache.proto {% if env == 'production' %} for server in ${MIRRORLIST_PROXY}; do rsync -az --delete-delay --delay-updates --delete \ + -e "ssh -i ${MM_SSH_KEY}" \ ${MM_ROOT}/src/utility/country_continent.csv \ ${CACHEDIR}/mirrorlist_cache.proto \ ${CACHEDIR}/*.txt \ # Netblocks - ${server}:/srv/mirrorlist/data/mirrorlist1/ & + ${MM_USER}@${server}:/srv/mirrorlist/data/mirrorlist1/ & done {% endif %}