From 375f66b59a9cad6fc60296c289b5201c89543184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Fri, 23 Feb 2024 00:31:14 +0100 Subject: [PATCH] MM: mount the ssh key in the cron images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- .../mirrormanager/files/deploymentconfig.yml | 7 ------- .../mirrormanager/templates/create_statistics.sh | 2 +- .../mirrormanager/templates/cron-accesses.yml | 14 ++++++++++++++ .../mirrormanager/templates/cron-crawler.yml | 5 +++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/roles/openshift-apps/mirrormanager/files/deploymentconfig.yml b/roles/openshift-apps/mirrormanager/files/deploymentconfig.yml index 17f7ab2736..cd865aa2f4 100644 --- a/roles/openshift-apps/mirrormanager/files/deploymentconfig.yml +++ b/roles/openshift-apps/mirrormanager/files/deploymentconfig.yml @@ -46,10 +46,6 @@ spec: - name: scripts mountPath: "/opt/scripts" readOnly: true - - name: ssh-key - mountPath: /etc/mirrormanager-ssh/ssh_mirrorlist_proxies.key - subPath: ssh_mirrorlist_proxies.key - readOnly: true # - name: ipa-config # mountPath: "/etc/ipa" # readOnly: true @@ -90,9 +86,6 @@ spec: - name: scripts configMap: name: scripts - - name: ssh-key - secret: - secretName: ssh-mirrorlist-proxies-key # - name: ipa-config # configMap: # name: ipa-client-config diff --git a/roles/openshift-apps/mirrormanager/templates/create_statistics.sh b/roles/openshift-apps/mirrormanager/templates/create_statistics.sh index cb164c97d5..9d099502f6 100644 --- a/roles/openshift-apps/mirrormanager/templates/create_statistics.sh +++ b/roles/openshift-apps/mirrormanager/templates/create_statistics.sh @@ -7,7 +7,7 @@ MIRRORLIST_LOGFILES="mirrorlist1.service.log mirrorlist2.service.log" SSH_KEY="/etc/mirrormanager-ssh/ssh_mirrorlist_proxies.key" REMOTE_USER="mirrormanager" -SSH="ssh -i ${SSH_KEY}" +SSH="ssh -i ${SSH_KEY} -o 'StrictHostKeyChecking no' -o 'BatchMode yes'" DATE=`date +%Y%m%d` OUTPUT=`mktemp -d` diff --git a/roles/openshift-apps/mirrormanager/templates/cron-accesses.yml b/roles/openshift-apps/mirrormanager/templates/cron-accesses.yml index 1d07a648d5..a2f57b4851 100644 --- a/roles/openshift-apps/mirrormanager/templates/cron-accesses.yml +++ b/roles/openshift-apps/mirrormanager/templates/cron-accesses.yml @@ -25,6 +25,10 @@ spec: - name: scripts mountPath: "/opt/scripts" readOnly: true + - name: ssh-key + mountPath: /etc/mirrormanager-ssh/ssh_mirrorlist_proxies.key + subPath: ssh_mirrorlist_proxies.key + readOnly: true volumes: - name: config configMap: @@ -32,6 +36,9 @@ spec: - name: scripts configMap: name: scripts + - name: ssh-key + secret: + secretName: ssh-mirrorlist-proxies-key --- ## Also include stats from the previous day apiVersion: batch/v1 @@ -60,6 +67,10 @@ spec: - name: scripts mountPath: "/opt/scripts" readOnly: true + - name: ssh-key + mountPath: /etc/mirrormanager-ssh/ssh_mirrorlist_proxies.key + subPath: ssh_mirrorlist_proxies.key + readOnly: true volumes: - name: config configMap: @@ -67,3 +78,6 @@ spec: - name: scripts configMap: name: scripts + - name: ssh-key + secret: + secretName: ssh-mirrorlist-proxies-key diff --git a/roles/openshift-apps/mirrormanager/templates/cron-crawler.yml b/roles/openshift-apps/mirrormanager/templates/cron-crawler.yml index 61b7f29df9..bb4f4c3b8d 100644 --- a/roles/openshift-apps/mirrormanager/templates/cron-crawler.yml +++ b/roles/openshift-apps/mirrormanager/templates/cron-crawler.yml @@ -24,12 +24,13 @@ spec: image: image-registry.openshift-image-registry.svc:5000/mirrormanager/mirrormanager2:latest command: - "/opt/app-root/bin/mm2_crawler" - - "--category" - - "{{ cronjob.category }}" - "--threads" - "{{ cronjob.threads }}" - "--timeout-minutes" - "240" + - "crawl" + - "--category" + - "{{ cronjob.category }}" volumeMounts: - name: config mountPath: "/etc/mirrormanager"