mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-04 23:50:20 -07:00
Correctly report "changed: false" when trying to install a package not in the catalog. This fixes #230
This commit is contained in:
parent
0ea2cf77dd
commit
474df33ff3
1 changed files with 8 additions and 3 deletions
|
@ -162,10 +162,15 @@ def main():
|
||||||
(rc, out, err) = package_uninstall(module, name)
|
(rc, out, err) = package_uninstall(module, name)
|
||||||
out = out[:75]
|
out = out[:75]
|
||||||
|
|
||||||
if rc is None:
|
if rc == 0:
|
||||||
result['changed'] = False
|
|
||||||
else:
|
|
||||||
result['changed'] = True
|
result['changed'] = True
|
||||||
|
else:
|
||||||
|
result['changed'] = False
|
||||||
|
|
||||||
|
if rc is not None and rc != 0:
|
||||||
|
result['failed'] = True
|
||||||
|
else:
|
||||||
|
result['failed'] = False
|
||||||
|
|
||||||
if out:
|
if out:
|
||||||
result['stdout'] = out
|
result['stdout'] = out
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue