public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: cel@kernel.org
To: <kdevops@lists.linux.dev>
Cc: ailiop@suse.com, Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH v1] fstests: Enable creation of group "123456-fsgqa" on Debian
Date: Wed, 17 Apr 2024 15:46:18 -0400	[thread overview]
Message-ID: <20240417194618.25093-1-cel@kernel.org> (raw)

From: Chuck Lever <chuck.lever@oracle.com>

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 <ailiop@suse.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 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


             reply	other threads:[~2024-04-17 19:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 19:46 cel [this message]
2024-04-17 19:48 ` [PATCH v1] fstests: Enable creation of group "123456-fsgqa" on Debian Chuck Lever III
2024-04-19 17:49 ` Luis Chamberlain
2024-04-19 17:54   ` Chuck Lever III

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240417194618.25093-1-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=ailiop@suse.com \
    --cc=chuck.lever@oracle.com \
    --cc=kdevops@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox