From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D02E326ED25 for ; Wed, 22 Apr 2026 22:17:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776896227; cv=none; b=oUN/nWvBIG06Jt6nKUjVkxpMiXx7nzFOCpUzL4X/XsxnHVWL/2xbU81FDCNiQFjcDjZQuDIDB5yM+7Pf6b/bc/EoYEabvy4GObDlmheffTtzRxDgb4aARevPyoQI997yvGVQKqHIItPx2FRpQTjmXXpsjtDZQJ2at83+990RpaU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776896227; c=relaxed/simple; bh=Aqet/jJT0PlNv0GXptcTSmDTzK5IJH3c/FGb5ZLDHRg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gVqp36+joHD8NEe3weWO/uh3T0EGG145Y3qSGSldJz04tXQF8RklSrRYgW4M92hJ9LM6BKicXN42MPT23s7FUWU/esrkwWNZZsTf5Ua+hfIvz6GvVeF0xt9kW2/JDTEkymZLGBO2JFtek5QGTPjVqtYTHKjZQ1hMA8CzuaSEG+M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=usO0rcvE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="usO0rcvE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 201A7C19425; Wed, 22 Apr 2026 22:17:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776896227; bh=Aqet/jJT0PlNv0GXptcTSmDTzK5IJH3c/FGb5ZLDHRg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=usO0rcvE3ByhBBqQl19oNcD8Wt+/lRWxQvTxsKzUeQHgySlSRHAG6oMiHDG51YT+T 4/zOkiO8rHGkLJf6J31zIMz5S7hQGxHto7Eqj2UsW5YB9BxH+z2Eq/gSeOMek1gRwe ggpNVFnQuWOtoqBFuz7lVDMESB5dpLWu0AtgZoxn3/Cg9e5k+atVWraU5+UF21qnPY ltdrqvQnlbAS2aulHha9XXjKkX5H9DcyRz2ea6Fvl9+1r42Cz8+OuVa/ajxheY3FJM dGjve55iJJs2MTRlkA3DkoJFyXfpDM4O1PytGFXOHDo9iNHziEo/LWizzKlsecW373 hnYz0uInEKY7A== From: Daniel Gomez Date: Thu, 23 Apr 2026 00:16:49 +0200 Subject: [PATCH 8/8] gen_hosts: drop sudo become on inventory owner refresh Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260423-kdevops-series-a-fixes-v1-8-69a82d0e1631@samsung.com> References: <20260423-kdevops-series-a-fixes-v1-0-69a82d0e1631@samsung.com> In-Reply-To: <20260423-kdevops-series-a-fixes-v1-0-69a82d0e1631@samsung.com> To: Luis Chamberlain , Chuck Lever Cc: kdevops@lists.linux.dev, Daniel Gomez , Daniel Gomez X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1776896208; l=1457; i=da.gomez@samsung.com; s=20240621; h=from:subject:message-id; bh=izqSpZl/7g/3Eiv70Ks+jSD2RMuSkNkKsjXMTVLPnuo=; b=XQqUbHJbeLDg0h2t6b4Ouf481acAc27fFnXqLWYI4PoQjMn/gZVwXN3NAx0v9jH5sJd43mnme Zk8wWcokOvXDguLM0uQKutID6jf/yIIkmr1jvX4ZlyBof7Fc4EavecB X-Developer-Key: i=da.gomez@samsung.com; a=ed25519; pk=BqYk31UHkmv0WZShES6pIZcdmPPGay5LbzifAdZ2Ia4= From: Daniel Gomez The inventory file is written by the same controller-side play that later refreshes its owner and group, and the refresh task sets owner to the current user and group to the current user's primary group - i.e. it chowns the file to its own owner. The task nevertheless wrapped that no-op in become_method: sudo + become_flags: "su - -c", and that combination fails at sudo invocation time with: /bin/sh: line 1: root: command not found The failure was masked by the task being guarded on the inventory file already existing, so it never fired on a freshly rendered tree. Drop the become block. The chown runs under the user the file already belongs to, and the gen_hosts role no longer depends on passwordless sudo on the control node. Generated-by: Claude AI Signed-off-by: Daniel Gomez --- playbooks/roles/gen_hosts/tasks/main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/playbooks/roles/gen_hosts/tasks/main.yml b/playbooks/roles/gen_hosts/tasks/main.yml index 0d67e49f..5e5acac0 100644 --- a/playbooks/roles/gen_hosts/tasks/main.yml +++ b/playbooks/roles/gen_hosts/tasks/main.yml @@ -37,9 +37,6 @@ register: kdevops_hosts_dest - name: Ensure proper permission on the inventory file - become: true - become_flags: "su - -c" - become_method: sudo ansible.builtin.file: path: "{{ ansible_cfg_inventory }}" owner: "{{ my_user.stdout }}" -- 2.53.0