From nobody Thu Apr 18 11:20:57 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 1520963152496279.9604961238175; Tue, 13 Mar 2018 10:45:52 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 83D61C05B030; Tue, 13 Mar 2018 17:45:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5ABE917F53; Tue, 13 Mar 2018 17:45:51 +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 3A8D7181B9FD; Tue, 13 Mar 2018 17:45:51 +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 w2DHjnF0009066 for ; Tue, 13 Mar 2018 13:45:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id B67D711301D0; Tue, 13 Mar 2018 17:45:49 +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 489C611301CD for ; Tue, 13 Mar 2018 17:45:49 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Tue, 13 Mar 2018 18:45:41 +0100 Message-Id: <20180313174545.14341-2-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 1/5] deploy: fixes for tester playbook 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 13 Mar 2018 17:45:51 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The playbook to deploy testers has a few issues: 1) it hard-codes the "tester" user instead of using the variable 2) it runs the cron job as a "patchew" user, but does not try to create it 3) the tasks are still run as root, so for example patchew-cli is copied in /root, the password is stored in /root. To fix this, I'm first of all just copying the entire patchew source tree in /data (for consistency with other playbooks), and then using "become" to run subsequent tasks as the right user. This is still not perfect, as it assumes that the patchew tree are other-readable and other-executable on the source machine, but a little better than before. --- scripts/playbooks/deploy-testers.yml | 43 ++++++++++++++++++++++++++++++--= ---- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/scripts/playbooks/deploy-testers.yml b/scripts/playbooks/deplo= y-testers.yml index fd9cb0a..4303e7e 100644 --- a/scripts/playbooks/deploy-testers.yml +++ b/scripts/playbooks/deploy-testers.yml @@ -18,25 +18,54 @@ - name: "tester_project" prompt: "Project name to test" private: no + vars: + base_dir: "/data/{{ instance_name }}" + src_dir: "{{ base_dir }}/src" + patchew_cmd: "{{ src_dir }}/patchew-cli -s {{ patchew_server }}" tasks: - debug: msg: Patchew tester deploy starting - - name: Copy patchew-cli + - name: "Ensure user patchew exists" + user: + name: patchew + shell: /bin/bash + state: present + - name: Create patchew data folder + file: + path: "{{ base_dir }}" + state: directory + - name: Copy source synchronize: - src: ../../../patchew-cli - dest: . + src: ../../../ + dest: "{{ src_dir }}" + recursive: true + group: no + owner: no + delete: yes + rsync_opts: + - "--exclude=3D*.pyc" + - "--exclude=3D*.swp" + - "--exclude=3D/venv" - name: Generate password file shell: "echo {{ tester_pass }} > $HOME/.patchew-tester-pass" + become: true + become_user: patchew - name: Login with patchew-cli - shell: "./patchew-cli login tester $(cat .patchew-tester-pass)" + shell: "{{ patchew_cmd }} login {{ tester_user }} $(cat $HOME/.patch= ew-tester-pass)" + become: true + become_user: patchew + - name: Logout with patchew-cli + shell: "{{ patchew_cmd }} logout" + become: true + become_user: patchew - name: Define PATCHEW env in cron cron: name: PATCHEW + user: patchew env: yes - value: "./patchew-cli -s {{ patchew_server }}" + value: "{{ patchew_cmd }}" - cron: name: "Patchew tester {{ instance_name }}" user: patchew minute: "*/10" - job: "{ $PATCHEW login tester $(cat .patchew-tester-pass); $PATCHE= W tester --name {{ instance_name }} --singleton -p {{ tester_project }}; } = >>$HOME/patchew-tester.log 2>&1" - + job: "{ $PATCHEW login {{ tester_user }} $(cat $HOME/.patchew-test= er-pass); $PATCHEW tester --name {{ instance_name }} --singleton -p {{ test= er_project }}; } >>$HOME/patchew-tester.log 2>&1" --=20 2.14.3 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Thu Apr 18 11:20:57 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 1520963152936222.723071546828; Tue, 13 Mar 2018 10:45:52 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E07FB128D; Tue, 13 Mar 2018 17:45:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6878A7A436; Tue, 13 Mar 2018 17:45:51 +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 33C9D180BAD3; Tue, 13 Mar 2018 17:45:50 +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 w2DHjoiR009076 for ; Tue, 13 Mar 2018 13:45:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 79E8311301D0; Tue, 13 Mar 2018 17:45:50 +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 073AA11301CD for ; Tue, 13 Mar 2018 17:45:49 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Tue, 13 Mar 2018 18:45:42 +0100 Message-Id: <20180313174545.14341-3-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 2/5] deploy: install Python 3 pip 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 13 Mar 2018 17:45:51 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We do not really need the Python 2.x pip for anything. In the end Python 3.x pip is probably already there because Fedora has it as a dependency of python3, but let's just be clean and install it. Signed-off-by: Paolo Bonzini --- scripts/playbooks/tasks/docker-deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/playbooks/tasks/docker-deploy.yml b/scripts/playbooks/= tasks/docker-deploy.yml index 21c8a8d..ec04306 100644 --- a/scripts/playbooks/tasks/docker-deploy.yml +++ b/scripts/playbooks/tasks/docker-deploy.yml @@ -1,10 +1,10 @@ --- -- name: Install pip - package: - name: python2-pip - name: Install Python 3 package: name: python34 +- name: Install pip + package: + name: python3-pip - name: Install docker package: name: docker --=20 2.14.3 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Thu Apr 18 11:20:57 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 1520963153298603.6776866013993; Tue, 13 Mar 2018 10:45:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 630EA18C368; Tue, 13 Mar 2018 17:45:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 562D35E1D3; Tue, 13 Mar 2018 17:45:52 +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 4C161181B9FD; Tue, 13 Mar 2018 17:45:52 +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 w2DHjp3g009083 for ; Tue, 13 Mar 2018 13:45:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3A7A211301D0; 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 BE69711301CD for ; Tue, 13 Mar 2018 17:45:50 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Tue, 13 Mar 2018 18:45:43 +0100 Message-Id: <20180313174545.14341-4-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 3/5] deploy: allow specifying CA path instead of fingerprint 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 13 Mar 2018 17:45:52 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The Arch wiki suggests that GMail changes its fingerprint occasionally; allow using a CA database (likely the system database, which is the default) instead of manually passing the fingerprint. Signed-off-by: Paolo Bonzini --- scripts/patchew-importer | 7 ++++++- scripts/playbooks/deploy-importers.yml | 4 ++++ scripts/playbooks/templates/importer-config.j2 | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/patchew-importer b/scripts/patchew-importer index 5e80fb5..d9de74f 100755 --- a/scripts/patchew-importer +++ b/scripts/patchew-importer @@ -48,12 +48,17 @@ remotehost =3D $IMAP_SERVER remoteuser =3D $IMAP_USER remotepass =3D $IMAP_PASS ssl=3D yes -cert_fingerprint =3D $IMAP_CERT_FINGERPRINT folderfilter =3D lambda foldername: foldername in [ $(for x in $IMAP_FOLDERS; do printf "'$x',"; done) ] EOF =20 +if test -n "$IMAP_CERT_FINGERPRINT"; then + echo "cert_fingerprint =3D $IMAP_CERT_FINGERPRINT" >>$offlineimap_rc +elif test -n "$SSL_CACERT_PATH"; then + echo "sslcacertfile =3D $SSL_CACERT_PATH" >> $offlineimap_rc +fi + IMPORTED_DIR=3D$BASEDIR/imported mkdir -p $IMPORTED_DIR =20 diff --git a/scripts/playbooks/deploy-importers.yml b/scripts/playbooks/dep= loy-importers.yml index 61e6057..8d362ee 100644 --- a/scripts/playbooks/deploy-importers.yml +++ b/scripts/playbooks/deploy-importers.yml @@ -28,6 +28,10 @@ prompt: "IMAP cert fingerprint" default: "" private: no + - name: "ssl_cacert_path" + prompt: "Path to SSL certificate authorities bundle" + default: "/etc/pki/tls/certs/ca-bundle.crt" + private: no - name: "imap_folders" prompt: "IMAP folders to look for patches" default: "INBOX" diff --git a/scripts/playbooks/templates/importer-config.j2 b/scripts/playb= ooks/templates/importer-config.j2 index 20fd2b8..b6bc844 100644 --- a/scripts/playbooks/templates/importer-config.j2 +++ b/scripts/playbooks/templates/importer-config.j2 @@ -8,3 +8,5 @@ IMAP_PASS=3D{{ imap_pass }} IMAP_CERT_FINGERPRINT=3D{{ imap_cert_fingerprint }} IMAP_FOLDERS=3D{{ imap_folders }} IMAP_DELETE_AFTER_IMPORT=3D{{ imap_delete_after_import }} + +SSL_CACERT_PATH=3D{{ ssl_cacert_path }} --=20 2.14.3 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Thu Apr 18 11:20:57 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 From nobody Thu Apr 18 11:20:57 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 1520963155317514.2027999740698; Tue, 13 Mar 2018 10:45:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6DC6A4E040; 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 6177C5D77D; 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 57DCDB3486; 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 w2DHjqTF009106 for ; Tue, 13 Mar 2018 13:45:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id B4E1011301D0; Tue, 13 Mar 2018 17:45:52 +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 4471611301CD for ; Tue, 13 Mar 2018 17:45:52 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Tue, 13 Mar 2018 18:45:45 +0100 Message-Id: <20180313174545.14341-6-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 5/5] deploy: allow specifying a different user to run the tester 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 13 Mar 2018 17:45:54 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Not sure if this is particularly useful, and it has the disadvantage of triggering an interactive session even if you're okay with the default user "patchew". But I'm throwing it out just in case (for example if you want tests running as root (!)). Signed-off-by: Paolo Bonzini --- scripts/playbooks/deploy-testers.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/playbooks/deploy-testers.yml b/scripts/playbooks/deplo= y-testers.yml index 4303e7e..ae3ab0b 100644 --- a/scripts/playbooks/deploy-testers.yml +++ b/scripts/playbooks/deploy-testers.yml @@ -18,6 +18,10 @@ - name: "tester_project" prompt: "Project name to test" private: no + - name: "cron_user" + prompt: "User that will run the tests on the host" + default: patchew + private: no vars: base_dir: "/data/{{ instance_name }}" src_dir: "{{ base_dir }}/src" @@ -25,9 +29,9 @@ tasks: - debug: msg: Patchew tester deploy starting - - name: "Ensure user patchew exists" + - name: "Ensure user {{ cron_user }} exists" user: - name: patchew + name: "{{ cron_user }}" shell: /bin/bash state: present - name: Create patchew data folder @@ -49,23 +53,23 @@ - name: Generate password file shell: "echo {{ tester_pass }} > $HOME/.patchew-tester-pass" become: true - become_user: patchew + become_user: "{{ cron_user }}" - name: Login with patchew-cli shell: "{{ patchew_cmd }} login {{ tester_user }} $(cat $HOME/.patch= ew-tester-pass)" become: true - become_user: patchew + become_user: "{{ cron_user }}" - name: Logout with patchew-cli shell: "{{ patchew_cmd }} logout" become: true - become_user: patchew + become_user: "{{ cron_user }}" - name: Define PATCHEW env in cron cron: name: PATCHEW - user: patchew + user: "{{ cron_user }}" env: yes value: "{{ patchew_cmd }}" - cron: name: "Patchew tester {{ instance_name }}" - user: patchew + user: "{{ cron_user }}" minute: "*/10" job: "{ $PATCHEW login {{ tester_user }} $(cat $HOME/.patchew-test= er-pass); $PATCHEW tester --name {{ instance_name }} --singleton -p {{ test= er_project }}; } >>$HOME/patchew-tester.log 2>&1" --=20 2.14.3 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel