1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix for #8886. Correct state=absent for statements without name/alias.

This commit is contained in:
Alexander Gubin 2014-09-04 14:35:39 +02:00
parent 5a7cbdda7e
commit 7b98294903

View file

@ -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)