Mirrormanager: specify the SSH key for the sync

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
Aurélien Bompard 2024-05-29 16:43:11 +02:00
parent c9f097dce0
commit e5533b2f3d
No known key found for this signature in database
GPG key ID: 31584CFEB9BF64AD
2 changed files with 6 additions and 3 deletions

View file

@ -66,7 +66,7 @@ spec:
containers: containers:
- name: mirrormanager - name: mirrormanager
image: image-registry.openshift-image-registry.svc:5000/mirrormanager/mirrormanager2:latest 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: volumeMounts:
- name: config - name: config
mountPath: "/etc/mirrormanager" mountPath: "/etc/mirrormanager"
@ -105,7 +105,7 @@ spec:
containers: containers:
- name: mirrormanager - name: mirrormanager
image: image-registry.openshift-image-registry.svc:5000/mirrormanager/mirrormanager2:latest 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: volumeMounts:
- name: config - name: config
mountPath: "/etc/mirrormanager" mountPath: "/etc/mirrormanager"

View file

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
MIRRORLIST_PROXY="{% for host in groups['mirrorlist_proxies'] %} {{ host }} {% endfor %}" MIRRORLIST_PROXY="{% for host in groups['mirrorlist_proxies'] %} {{ host }} {% endfor %}"
MM_USER=mirrormanager
MM_ROOT=/opt/app-root MM_ROOT=/opt/app-root
MM_SSH_KEY=/etc/mirrormanager-ssh/ssh_mirrorlist_proxies.key
CACHEDIR=/data CACHEDIR=/data
set -e set -e
@ -20,9 +22,10 @@ ${MM_ROOT}/bin/generate-mirrorlist-cache -o ${CACHEDIR}/mirrorlist_cache.proto
{% if env == 'production' %} {% if env == 'production' %}
for server in ${MIRRORLIST_PROXY}; do for server in ${MIRRORLIST_PROXY}; do
rsync -az --delete-delay --delay-updates --delete \ rsync -az --delete-delay --delay-updates --delete \
-e "ssh -i ${MM_SSH_KEY}" \
${MM_ROOT}/src/utility/country_continent.csv \ ${MM_ROOT}/src/utility/country_continent.csv \
${CACHEDIR}/mirrorlist_cache.proto \ ${CACHEDIR}/mirrorlist_cache.proto \
${CACHEDIR}/*.txt \ # Netblocks ${CACHEDIR}/*.txt \ # Netblocks
${server}:/srv/mirrorlist/data/mirrorlist1/ & ${MM_USER}@${server}:/srv/mirrorlist/data/mirrorlist1/ &
done done
{% endif %} {% endif %}