mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-20 15:51:05 +00:00
Added support of returning owner's group name in stat module
This commit is contained in:
@@ -66,6 +66,7 @@ import os
|
||||
import sys
|
||||
from stat import *
|
||||
import pwd
|
||||
import grp
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
@@ -141,6 +142,9 @@ def main():
|
||||
pw = pwd.getpwuid(st.st_uid)
|
||||
|
||||
d['pw_name'] = pw.pw_name
|
||||
|
||||
grp_info = grp.getgrgid(pw.pw_gid)
|
||||
d['gr_name'] = grp_info.gr_name
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user