diff --git a/lib/ansible/modules/file.py b/lib/ansible/modules/file.py index 564d7f6cdbe..bab8deb5488 100644 --- a/lib/ansible/modules/file.py +++ b/lib/ansible/modules/file.py @@ -133,6 +133,11 @@ EXAMPLES = r''' group: foo mode: '0644' +- name: Change file group using gid + ansible.builtin.file: + path: /etc/bar.conf + group: "1000" + - name: Give insecure permissions to an existing file ansible.builtin.file: path: /work diff --git a/lib/ansible/plugins/doc_fragments/files.py b/lib/ansible/plugins/doc_fragments/files.py index ec762676ca0..bf53c3c72ee 100644 --- a/lib/ansible/plugins/doc_fragments/files.py +++ b/lib/ansible/plugins/doc_fragments/files.py @@ -33,7 +33,7 @@ options: type: raw owner: description: - - Name of the user that should own the filesystem object, as would be fed to I(chown). + - Name of the user or gid that should own the filesystem object, as would be fed to I(chown). - When left unspecified, it uses the current user unless you are root, in which case it can preserve the previous ownership. - Specifying a numeric username will be assumed to be a user ID and not a username. Avoid numeric usernames to avoid this confusion.