Fix for #8886. Correct state=absent for statements without name/alias.
This commit is contained in:
parent
1d5a4be997
commit
8bdd5240aa
1 changed files with 3 additions and 1 deletions
|
@ -192,11 +192,13 @@ def main():
|
|||
if name:
|
||||
module.fail_json(msg='Incompatible option: \'name\'. Do not use name when adding repo files')
|
||||
else:
|
||||
if not name:
|
||||
if not name and state == "present":
|
||||
module.fail_json(msg='Name required when adding non-repo files:')
|
||||
|
||||
if repo and repo.endswith('.repo'):
|
||||
exists = repo_exists(module, url=repo, alias=name)
|
||||
elif repo:
|
||||
exists = repo_exists(module, url=repo)
|
||||
else:
|
||||
exists = repo_exists(module, alias=name)
|
||||
|
||||
|
|
Loading…
Reference in a new issue