From c8cefdb9e76654f8db0def687c3acf161bebd727 Mon Sep 17 00:00:00 2001 From: remz42 Date: Tue, 16 Apr 2024 09:59:58 +0200 Subject: [PATCH 1/2] Updating doc with gid in file module --- lib/ansible/modules/file.py | 5 +++++ lib/ansible/plugins/doc_fragments/files.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/file.py b/lib/ansible/modules/file.py index 564d7f6cdbe0bc..bab8deb54882a7 100644 --- a/lib/ansible/modules/file.py +++ b/lib/ansible/modules/file.py @@ -133,6 +133,11 @@ 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 ec762676ca02af..bf53c3c72ee19d 100644 --- a/lib/ansible/plugins/doc_fragments/files.py +++ b/lib/ansible/plugins/doc_fragments/files.py @@ -33,7 +33,7 @@ class ModuleDocFragment(object): 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. From 6a1ffb3dd1b2fd24127c63391a562ec7ae86ffe5 Mon Sep 17 00:00:00 2001 From: Remz42 <137795127+Remz42@users.noreply.github.com> Date: Wed, 17 Apr 2024 08:41:40 +0200 Subject: [PATCH 2/2] Move gid to the group instead of user --- lib/ansible/plugins/doc_fragments/files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/doc_fragments/files.py b/lib/ansible/plugins/doc_fragments/files.py index bf53c3c72ee19d..55e5a00987ca4e 100644 --- a/lib/ansible/plugins/doc_fragments/files.py +++ b/lib/ansible/plugins/doc_fragments/files.py @@ -33,7 +33,7 @@ class ModuleDocFragment(object): type: raw owner: description: - - Name of the user or gid that should own the filesystem object, as would be fed to I(chown). + - Name of the user 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. @@ -41,7 +41,7 @@ class ModuleDocFragment(object): type: str group: description: - - Name of the group that should own the filesystem object, as would be fed to I(chown). + - Name of the group or gid that should own the filesystem object, as would be fed to I(chown). - When left unspecified, it uses the current group of the current user unless you are root, in which case it can preserve the previous ownership. type: str