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 A83762134B for ; Wed, 17 Apr 2024 19:46:24 +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=1713383184; cv=none; b=q0cYxjOeNWA+LAxS2oAO9uXz1hlXyZzxw5yfttrMIr9z2t9sT5evpOQFBHHSgE4phPgiuL7j5AIWWMWGdLNvHLCFi3tQKUStAa+LsGSH/FWUnkmxysjEpLATn2zsKeQmVE4Zxtge1U4KQ5Cha6ZFUNcGC+N4mq952aYSG5G7c1s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713383184; c=relaxed/simple; bh=qs4LRoI4uKzYwsuIPmNtB0E5j5fV3GjXe92YDZAYvPc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mU0SJAJR8KrnYw3SwhTEug724ewetPV86z/PxTvtztaXnzBLRrw1lk6JQrKtWZ8YDNtCmUmN/RKW8QFrr7Vp8mdWuXu86s9fqc4Q4gaTL46JyRgYTgfe3BS41Nx+l9Nem7cgb9TTfuoUjgNqTH/OO6s8dMAMHY/WL/l5mgDx7EY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VmFF9jWS; 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="VmFF9jWS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1E9EC072AA; Wed, 17 Apr 2024 19:46:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713383184; bh=qs4LRoI4uKzYwsuIPmNtB0E5j5fV3GjXe92YDZAYvPc=; h=From:To:Cc:Subject:Date:From; b=VmFF9jWSI0e/jjjfDYkiEGUUNCrzAeZzPBvs5tu8ij/kqvAxHq18hAhjqXPnuv3fI YjE4MJJw/1CNtBx9yY2CmghjTRTz53/qVhEmliBBrLbrvWcSQKNGucOqxT0BltN6nM 8Dbe/ZMV7/aiNPeeCScFD7W0oQuMZ0Lml8Qn+Ip4WLd/if7FwLx7vmPZlSVwwt90n1 KGaTCqP17b9TS1ghRLzGcsQsxN38fJ74K/xyhlpu5MfnHKlVs1hv5Rj35zaChrO/vP sYcR8Qa87dC/QTwrgrk7bpMpXeByWDmPUt8LvL6vYaDXpSGCP1FpSAQGnrqeaKJLv7 gCPGGcTH+RxLA== From: cel@kernel.org To: Cc: ailiop@suse.com, Chuck Lever Subject: [PATCH v1] fstests: Enable creation of group "123456-fsgqa" on Debian Date: Wed, 17 Apr 2024 15:46:18 -0400 Message-ID: <20240417194618.25093-1-cel@kernel.org> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chuck Lever While testing fstests on Debian, I encountered: TASK [fstests : Add missing groups for fstests] ************************************************************************************************ changed: [cel-tmpfs-default] => (item=Ensuring the group sys exists) failed: [cel-tmpfs-default] (item=Ensuring the group 123456-fsgqa exists) => { "ansible_loop_var": "item", "changed": false, "item": "123456-fsgqa", "name": "123456-fsgqa" } MSG: groupadd: '123456-fsgqa' is not a valid group name Suggested-by: Anthony Iliopoulos Signed-off-by: Chuck Lever --- playbooks/roles/fstests/tasks/main.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/playbooks/roles/fstests/tasks/main.yml b/playbooks/roles/fstests/tasks/main.yml index 63531f618b4b..b984ff589476 100644 --- a/playbooks/roles/fstests/tasks/main.yml +++ b/playbooks/roles/fstests/tasks/main.yml @@ -874,24 +874,15 @@ state: present with_items: - sys - - 123456-fsgqa - - fsgqa - - fsgqa2 - - daemon - - nobody loop_control: - label: "Ensuring the group {{ item }} exists" + label: "Ensuring that group {{ item }} exists" -- name: Add missing users if not present +- name: Add missing users for fstests tags: [ 'oscheck', 'fstests', 'install', 'root'] become: yes become_flags: 'su - -c' become_method: sudo - user: - name: "{{ item }}" - state: present - home: "/home/{{ item }}" - group: "{{ item }}" + ansible.builtin.command: "useradd --badname -d /home/{{ item }} -U {{ item }}" with_items: - 123456-fsgqa - fsgqa @@ -899,7 +890,9 @@ - daemon - nobody loop_control: - label: "Ensuring the user {{ item }} exists" + label: "Ensuring that user and group {{ item }} exists" + register: useradd_result + failed_when: useradd_result.rc != 0 and useradd_result.rc != 9 - name: Verify section name {{ fstests_section }} exists on fstests config file vars: base-commit: 096d2295b30fd72192cec80a234bd2153103b0cd -- 2.44.0