diff --git a/lib/ansible/modules/files/stat.py b/lib/ansible/modules/files/stat.py index 2a9189e532..1544a02880 100644 --- a/lib/ansible/modules/files/stat.py +++ b/lib/ansible/modules/files/stat.py @@ -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