group: remove extraneous warning (#81557)

* remove extraneous warning shown when group does not exist

Fixes: #77049

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde
2023-08-22 11:23:10 -04:00
committed by GitHub
parent 4a96b3d5b4
commit aa8a29a9d4
2 changed files with 3 additions and 7 deletions
+3
View File
@@ -0,0 +1,3 @@
---
minor_changes:
- group - remove extraneous warning shown when user does not exist (https://github.com/ansible/ansible/issues/77049).
-7
View File
@@ -227,14 +227,7 @@ class Group(object):
if line.startswith(to_bytes(name_test)):
exists = True
break
if not exists:
self.module.warn(
"'local: true' specified and group was not found in {file}. "
"The local group may already exist if the local group database exists somewhere other than {file}.".format(file=self.GROUPFILE))
return exists
else:
try:
if grp.getgrnam(self.name):