mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-28 21:31:26 -07:00
* sudoers: fix handling of state: absent (#4852)
* typo fixes
(cherry picked from commit 44e21dd407
)
Co-authored-by: s-hamann <10639154+s-hamann@users.noreply.github.com>
This commit is contained in:
parent
48fbd69835
commit
f8650f8d85
3 changed files with 22 additions and 3 deletions
|
@ -168,9 +168,12 @@ class Sudoers(object):
|
|||
return "{owner} ALL={runas}{nopasswd} {commands}\n".format(owner=owner, runas=runas_str, nopasswd=nopasswd_str, commands=commands_str)
|
||||
|
||||
def run(self):
|
||||
if self.state == 'absent' and self.exists():
|
||||
self.delete()
|
||||
return True
|
||||
if self.state == 'absent':
|
||||
if self.exists():
|
||||
self.delete()
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
if self.exists() and self.matches():
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue