From nobody Fri Apr 26 08:21:23 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 1548953124600451.0563346438578; Thu, 31 Jan 2019 08:45:24 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 47A5A2D7F0; Thu, 31 Jan 2019 16:45:23 +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 3866A19492; Thu, 31 Jan 2019 16:45:23 +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 254F93F603; Thu, 31 Jan 2019 16:45:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0VGj7C2018319 for ; Thu, 31 Jan 2019 11:45:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id 732B760152; Thu, 31 Jan 2019 16:45:07 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8B63600C2 for ; Thu, 31 Jan 2019 16:45:03 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 31 Jan 2019 17:45:02 +0100 Message-Id: <20190131164502.23700-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH] deploy: rewrite 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: , Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 31 Jan 2019 16:45:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The tester deployment playbook is not using become correctly and thus does not copy the source to the destination directory for the right user. While at it, also modify it so that the password and log are stored under the per-instance data directory, allowing more tester instances to run with the same user. Signed-off-by: Paolo Bonzini --- scripts/playbooks/deploy-testers.yml | 31 +++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/scripts/playbooks/deploy-testers.yml b/scripts/playbooks/deplo= y-testers.yml index 7b375db..a875d99 100644 --- a/scripts/playbooks/deploy-testers.yml +++ b/scripts/playbooks/deploy-testers.yml @@ -24,8 +24,8 @@ private: no vars: base_dir: "{{ instance_name }}" - src_dir: "{{ base_dir }}/src" - patchew_cmd: "{{ src_dir }}/patchew-cli -s {{ patchew_server }}" + dest_base_dir: "~{{ cron_user }}/{{ base_dir }}" + patchew_cmd: "{{ base_dir }}/src/patchew-cli -s {{ patchew_server }}" tasks: - debug: msg: Patchew tester deploy starting @@ -35,13 +35,16 @@ shell: /bin/bash state: present - name: Create patchew data folder + become: yes + become_user: "{{ cron_user }}" file: - path: "{{ base_dir }}" + path: "{{ dest_base_dir }}" state: directory - name: Copy source + remote_user: "{{ cron_user }}" synchronize: src: ../../../ - dest: "{{ src_dir }}" + dest: "{{ dest_base_dir }}/src" recursive: true group: no owner: no @@ -51,19 +54,19 @@ - "--exclude=3D*.swp" - "--exclude=3D/venv" - name: Generate password file - shell: "echo {{ tester_pass }} > $HOME/.patchew-tester-pass" + become: yes + become_user: "{{ cron_user }}" + shell: "cd ~{{ cron_user }} && echo {{ tester_pass }} > {{ base_dir = }}/patchew-tester-pass" - name: Login with patchew-cli - shell: "{{ patchew_cmd }} login {{ tester_user }} $(cat $HOME/.patch= ew-tester-pass)" + become: yes + become_user: "{{ cron_user }}" + shell: "cd ~{{ cron_user }} && {{ patchew_cmd }} login {{ tester_use= r }} $(cat {{ base_dir }}/patchew-tester-pass)" - name: Logout with patchew-cli - shell: "{{ patchew_cmd }} logout" - - name: Define PATCHEW env in cron - cron: - name: PATCHEW - user: "{{ cron_user }}" - env: yes - value: "{{ patchew_cmd }}" + become: yes + become_user: "{{ cron_user }}" + shell: "cd ~{{ cron_user }} && {{ patchew_cmd }} logout" - cron: name: "Patchew tester {{ instance_name }}" 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" + job: "{ {{ patchew_cmd }} login {{ tester_user }} $(cat {{ base_di= r }}/patchew-tester-pass); {{ patchew_cmd }} tester --name {{ instance_name= }} --singleton -p {{ tester_project }}; } >>{{ base_dir }}/log 2>&1" --=20 2.20.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel