|
|
@ -72,7 +72,7 @@ import sys
|
|
|
|
|
|
|
|
|
|
|
|
def query_package(module, pkgin_path, name):
|
|
|
|
def query_package(module, pkgin_path, name):
|
|
|
|
|
|
|
|
|
|
|
|
rc, out, err = module.run_command("%s info -e %s" % (pkgin_path, name))
|
|
|
|
rc, out, err = module.run_command("%s info -g -e %s" % (pkgin_path, name))
|
|
|
|
|
|
|
|
|
|
|
|
if rc == 0:
|
|
|
|
if rc == 0:
|
|
|
|
return True
|
|
|
|
return True
|
|
|
@ -121,7 +121,7 @@ def install_packages(module, pkgin_path, packages, cached, pkgsite):
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
if not module.check_mode:
|
|
|
|
if not module.check_mode:
|
|
|
|
rc, out, err = module.run_command("%s %s install -U -y %s" % (pkgsite, pkgin_path, package))
|
|
|
|
rc, out, err = module.run_command("%s %s install -g -U -y %s" % (pkgsite, pkgin_path, package))
|
|
|
|
|
|
|
|
|
|
|
|
if not module.check_mode and not query_package(module, pkgin_path, package):
|
|
|
|
if not module.check_mode and not query_package(module, pkgin_path, package):
|
|
|
|
module.fail_json(msg="failed to install %s: %s" % (package, out), stderr=err)
|
|
|
|
module.fail_json(msg="failed to install %s: %s" % (package, out), stderr=err)
|
|
|
|