From nobody Fri Oct 25 19:37:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520963155797228.33725345494497; Tue, 13 Mar 2018 10:45:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD33180088; Tue, 13 Mar 2018 17:45:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0FEC5D9C6; Tue, 13 Mar 2018 17:45:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C31B9B3486; Tue, 13 Mar 2018 17:45:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2DHjqr3009098 for ; Tue, 13 Mar 2018 13:45:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id EE64410A7E21; Tue, 13 Mar 2018 17:45:51 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-103.ams2.redhat.com [10.36.116.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7FC14111CB9C for ; Tue, 13 Mar 2018 17:45:51 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Tue, 13 Mar 2018 18:45:44 +0100 Message-Id: <20180313174545.14341-5-pbonzini@redhat.com> In-Reply-To: <20180313174545.14341-1-pbonzini@redhat.com> References: <20180313174545.14341-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 4/5] deploy: allow specifying a private key for the importer X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 13 Mar 2018 17:45:54 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The Dockerfile for the importer was creating an unused SSH key. Instead, pass a private key for use in connecting to the git server. Signed-off-by: Paolo Bonzini --- This patch is mostly untested. I only checked that the key is there in the container. scripts/dockerfiles/importer.docker | 2 +- scripts/playbooks/deploy-importers.yml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/dockerfiles/importer.docker b/scripts/dockerfiles/impo= rter.docker index bca985b..984f019 100644 --- a/scripts/dockerfiles/importer.docker +++ b/scripts/dockerfiles/importer.docker @@ -2,7 +2,7 @@ FROM fedora:latest RUN dnf install -y python offlineimap findutils git wget RUN git config --global user.email "importer@patchew.org" RUN git config --global user.name "Patchew Importer" -RUN ssh-keygen -t rsa -q -C patchew-importer -f ~/.ssh/id_rsa +RUN echo IdentityFile=3D/data/patchew/identity > ~/.ssh/config RUN echo StrictHostKeyChecking no >> ~/.ssh/config RUN echo UserKnownHostsFile=3D/dev/null >> ~/.ssh/config ENV LC_ALL en_US.UTF-8 diff --git a/scripts/playbooks/deploy-importers.yml b/scripts/playbooks/dep= loy-importers.yml index 8d362ee..1a9d805 100644 --- a/scripts/playbooks/deploy-importers.yml +++ b/scripts/playbooks/deploy-importers.yml @@ -15,6 +15,9 @@ - name: "importer_pass" prompt: "Password for the importer to login to the server" private: yes + - name: "importer_identity" + prompt: "Path to file containing private key" + private: no - name: "imap_server" prompt: "IMAP server address to download patches" private: no @@ -45,11 +48,18 @@ src_dir: "{{ base_dir }}/src" data_dir: "{{ base_dir }}/data" config_file: "{{ data_dir }}/config" + identity_file: "{{ data_dir }}/identity" tasks: - name: Create data dir file: path: "{{ data_dir }}" state: directory + - name: Store SSH key + copy: + src: "{{ importer_identity }}" + dest: "{{ identity_file }}" + validate: test -f %s + mode: 0400 - name: Create config template: src: "templates/importer-config.j2" --=20 2.14.3 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel