From 68096c274457c8b86a4f1bc86a03b95c06c4c5fb Mon Sep 17 00:00:00 2001 From: Tongliang Liu Date: Thu, 11 Sep 2014 13:31:07 -0700 Subject: [PATCH] Added support for returning owner's group name in stat module #8967. --- library/files/stat | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/files/stat b/library/files/stat index 8c717a395c..36ef714578 100644 --- a/library/files/stat +++ b/library/files/stat @@ -66,6 +66,7 @@ import os import sys from stat import * import pwd +import grp def main(): module = AnsibleModule( @@ -140,6 +141,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