|
|
@ -288,7 +288,7 @@ def _mark_package_install(module, base, pkg_spec):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
base.install(pkg_spec)
|
|
|
|
base.install(pkg_spec)
|
|
|
|
except dnf.exceptions.MarkingError:
|
|
|
|
except dnf.exceptions.MarkingError:
|
|
|
|
module.fail_json(msg="No package {} available.".format(pkg_spec))
|
|
|
|
module.fail_json(msg="No package {0} available.".format(pkg_spec))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _parse_spec_group_file(names):
|
|
|
|
def _parse_spec_group_file(names):
|
|
|
@ -340,7 +340,7 @@ def ensure(module, base, state, names):
|
|
|
|
environments.append(environment.id)
|
|
|
|
environments.append(environment.id)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
module.fail_json(
|
|
|
|
module.fail_json(
|
|
|
|
msg="No group {} available.".format(group_spec))
|
|
|
|
msg="No group {0} available.".format(group_spec))
|
|
|
|
|
|
|
|
|
|
|
|
if state in ['installed', 'present']:
|
|
|
|
if state in ['installed', 'present']:
|
|
|
|
# Install files.
|
|
|
|
# Install files.
|
|
|
@ -409,7 +409,7 @@ def ensure(module, base, state, names):
|
|
|
|
# Group is already uninstalled.
|
|
|
|
# Group is already uninstalled.
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
for envioronment in environments:
|
|
|
|
for environment in environments:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
base.environment_remove(environment)
|
|
|
|
base.environment_remove(environment)
|
|
|
|
except dnf.exceptions.CompsError:
|
|
|
|
except dnf.exceptions.CompsError:
|
|
|
@ -427,13 +427,15 @@ def ensure(module, base, state, names):
|
|
|
|
|
|
|
|
|
|
|
|
if not base.resolve(allow_erasing=allow_erasing):
|
|
|
|
if not base.resolve(allow_erasing=allow_erasing):
|
|
|
|
if failures:
|
|
|
|
if failures:
|
|
|
|
module.fail_json(msg='Failed to install some of the specified packages',
|
|
|
|
module.fail_json(msg='Failed to install some of the '
|
|
|
|
|
|
|
|
'specified packages',
|
|
|
|
failures=failures)
|
|
|
|
failures=failures)
|
|
|
|
module.exit_json(msg="Nothing to do")
|
|
|
|
module.exit_json(msg="Nothing to do")
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
if module.check_mode:
|
|
|
|
if module.check_mode:
|
|
|
|
if failures:
|
|
|
|
if failures:
|
|
|
|
module.fail_json(msg='Failed to install some of the specified packages',
|
|
|
|
module.fail_json(msg='Failed to install some of the '
|
|
|
|
|
|
|
|
'specified packages',
|
|
|
|
failures=failures)
|
|
|
|
failures=failures)
|
|
|
|
module.exit_json(changed=True)
|
|
|
|
module.exit_json(changed=True)
|
|
|
|
|
|
|
|
|
|
|
@ -446,7 +448,8 @@ def ensure(module, base, state, names):
|
|
|
|
response['results'].append("Removed: {0}".format(package))
|
|
|
|
response['results'].append("Removed: {0}".format(package))
|
|
|
|
|
|
|
|
|
|
|
|
if failures:
|
|
|
|
if failures:
|
|
|
|
module.fail_json(msg='Failed to install some of the specified packages',
|
|
|
|
module.fail_json(msg='Failed to install some of the '
|
|
|
|
|
|
|
|
'specified packages',
|
|
|
|
failures=failures)
|
|
|
|
failures=failures)
|
|
|
|
module.exit_json(**response)
|
|
|
|
module.exit_json(**response)
|
|
|
|
|
|
|
|
|
|
|
|