[stable-2.16] Issue #80267: Remove user not found warning (#80291) (#83078)

(cherry picked from commit e0bf76e)

Co-authored-by: Sebbo94BY <Sebastian-Kraetzig@gmx.de>
pull/83226/head
Matt Martz 2 years ago committed by GitHub
parent 40bdb2b471
commit 5d3a372ef6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
minor_changes:
- ansible.builtin.user - Remove user not found warning (https://github.com/ansible/ansible/issues/80267)

@ -1063,12 +1063,6 @@ class User(object):
exists = True
break
if not exists:
self.module.warn(
"'local: true' specified and user '{name}' was not found in {file}. "
"The local user account may already exist if the local account database exists "
"somewhere other than {file}.".format(file=self.PASSWORDFILE, name=self.name))
return exists
else:

@ -224,8 +224,6 @@
- name: Ensure warnings were displayed properly
assert:
that:
- local_user_test_1['warnings'] | length > 0
- local_user_test_1['warnings'] | first is search('The local user account may already exist')
- local_user_test_5['warnings'] is search("'append' is set, but no 'groups' are specified. Use 'groups'")
- local_existing['warnings'] is not defined
when: ansible_facts.system in ['Linux']

Loading…
Cancel
Save