public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH v1] fstests: Enable creation of group "123456-fsgqa" on Debian
@ 2024-04-17 19:46 cel
  2024-04-17 19:48 ` Chuck Lever III
  2024-04-19 17:49 ` Luis Chamberlain
  0 siblings, 2 replies; 4+ messages in thread
From: cel @ 2024-04-17 19:46 UTC (permalink / raw)
  To: kdevops; +Cc: ailiop, Chuck Lever

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-19 17:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-17 19:46 [PATCH v1] fstests: Enable creation of group "123456-fsgqa" on Debian cel
2024-04-17 19:48 ` Chuck Lever III
2024-04-19 17:49 ` Luis Chamberlain
2024-04-19 17:54   ` Chuck Lever III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox