Skip to contentSkip to conversation

fstests: Enable creation of group "123456-fsgqa" on Debian

PATCH In review [email protected] 3 participants 4 messages Apr 17, 2024 – Apr 19, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fstests: Enable creation of group "123456-fsgqa" on Debian

From: Chuck Lever <[email protected]>

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

---
 playbooks/roles/fstests/tasks/main.yml | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)
playbooks/roles/fstests/tasks/main.yml +6 -13
index 63531f618b4b..b984ff589476 100644
@@ -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

Signature · 1 line
2.44.0
#1 lore raw
Quoted 7 lines · On Apr 17, 2024, at 3:46 PM, [email protected] wrote:

From: Chuck Lever <[email protected]>

While testing fstests on Debian, I encountered:

Whoops. ^Debian^SuSE

Quoted 63 lines

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

---
playbooks/roles/fstests/tasks/main.yml | 19 ++++++-------------

1 file changed, 6 insertions(+), 13 deletions(-)
playbooks/roles/fstests/tasks/main.yml +6 -14
index 63531f618b4b..b984ff589476 100644
@@ -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:
Quoted 5 lines

base-commit: 096d2295b30fd72192cec80a234bd2153103b0cd

Signature · 1 line
2.44.0

--
Chuck Lever

Reviewed-by on v1 1/1
#2 lore raw
In reply to [email protected]
Quoted 13 lines · On Wed, Apr 17, 2024 at 03:46:18PM -0400, [email protected] wrote:

From: Chuck Lever <[email protected]>

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"
}

Quoted 7 lines

MSG:

groupadd: '123456-fsgqa' is not a valid group name

---

Luis

#3 lore raw
Quoted 20 lines · Luis Chamberlain
Quoted 15 lines · On Wed, Apr 17, 2024 at 03:46:18PM -0400, [email protected] wrote:

From: Chuck Lever <[email protected]>

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:

Quoted 7 lines
Quoted 5 lines

groupadd: '123456-fsgqa' is not a valid group name

---

Thanks! Pushed.

--
Chuck Lever