From nobody Fri Oct 25 19:31:24 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