Merge branch '7645' of https://github.com/kcghost/ansible into kcghost-7645
This commit is contained in:
commit
eb57ceee96
1 changed files with 12 additions and 4 deletions
|
@ -152,7 +152,7 @@ def package_install(module, name, src, proxy, response_file, zone, category):
|
||||||
os.unlink(adminfile)
|
os.unlink(adminfile)
|
||||||
return (rc, out, err)
|
return (rc, out, err)
|
||||||
|
|
||||||
def package_uninstall(module, name, src):
|
def package_uninstall(module, name, src, category):
|
||||||
adminfile = create_admin_file()
|
adminfile = create_admin_file()
|
||||||
if category:
|
if category:
|
||||||
cmd = [ 'pkgrm', '-na', adminfile, '-Y', name ]
|
cmd = [ 'pkgrm', '-na', adminfile, '-Y', name ]
|
||||||
|
@ -209,10 +209,18 @@ def main():
|
||||||
(rc, out, err) = package_uninstall(module, name, src, category)
|
(rc, out, err) = package_uninstall(module, name, src, category)
|
||||||
out = out[:75]
|
out = out[:75]
|
||||||
|
|
||||||
if rc is None:
|
#Success,Warning,Interruption,Reboot all,Reboot this return codes
|
||||||
result['changed'] = False
|
if rc is 0 or rc is 2 or rc is 3 or rc is 10 or rc is 20:
|
||||||
else:
|
|
||||||
result['changed'] = True
|
result['changed'] = True
|
||||||
|
#no install nor uninstall, or failed
|
||||||
|
else:
|
||||||
|
result['changed'] = False
|
||||||
|
|
||||||
|
#Fatal error,Administration,Administration Interaction return codes
|
||||||
|
if rc is 1 or rc is 4 or rc is 5:
|
||||||
|
result['failed'] = True
|
||||||
|
else:
|
||||||
|
result['failed'] = False
|
||||||
|
|
||||||
if out:
|
if out:
|
||||||
result['stdout'] = out
|
result['stdout'] = out
|
||||||
|
|
Loading…
Reference in a new issue