File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
tests/facts/server.Groups Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -391,7 +391,14 @@ class Groups(FactBase[List[str]]):
391
391
"""
392
392
393
393
def command (self ):
394
- return "cat /etc/group"
394
+ # getent will return the same output as `cat /etc/groups` but will
395
+ # respect nsswitch.conf settings, e.g. for using LDAP as additional source
396
+ # Note, that LDAP e.g. using sssd might be configured to not enumerate
397
+ # all groups / users, in which case only the local groups will be returned
398
+ return "getent group"
399
+
400
+ def requires_command (self ) -> str :
401
+ return "getent"
395
402
396
403
default = list
397
404
Original file line number Diff line number Diff line change 1
1
{
2
- "command" : " cat /etc/group" ,
2
+ "command" : " getent group" ,
3
+ "requires_command" : " getent" ,
3
4
"output" : [
4
5
" lpadmin:x:114:vagrant" ,
5
6
" sambashare:x:115:vagrant" ,
You can’t perform that action at this time.
0 commit comments