pull/79046/head
Matt Martz 1 year ago
parent b282facd5b
commit 7db792add3
No known key found for this signature in database
GPG Key ID: 40832D88E9FC91D8

@ -1203,16 +1203,21 @@ class ActionBase(ABC):
data['deprecations'].extend(self._discovery_deprecation_warnings)
if res['rc'] and data.get('_ansible_parsed') and not data.get('failed'):
data |= {
'failed': True,
'module_rc': res['rc'],
'msg': 'The module exited with a non-zero rc but was not marked as failed. This indicates a module execution failure.'
}
if 'module_stdout' not in data:
data |= {
'module_stdout': res.get('stdout', ''),
'module_stderr': res.get('stderr', ''),
}
data.setdefault('warnings', []).append(
f'The module ({self._task.resolved_action}) exited with a non-zero rc but was not marked as failed. '
'This may indicate a module execution failure or other module execution related issue. '
'Running with ANSIBLE_DEBUG=1 may provide more information.'
)
# data |= {
# 'failed': True,
# 'module_rc': res['rc'],
# 'msg': 'The module exited with a non-zero rc but was not marked as failed. This indicates a module execution failure.'
# }
# if 'module_stdout' not in data:
# data |= {
# 'module_stdout': res.get('stdout', ''),
# 'module_stderr': res.get('stderr', ''),
# }
# mark the entire module results untrusted as a template right here, since the current action could
# possibly template one of these values.

@ -29,10 +29,12 @@
- missing_stdout is failed
- missing_stdout.msg.splitlines()|first == empty_stdout
- non_zero_rc is failed
- non_zero_rc.module_rc == 2
- non_zero_rc.module_stdout is defined
- non_zero_rc.module_stderr is defined
- non_zero_rc is successful
- non_zero_rc.warnings is defined
- non_zero_rc.warnings|select('search', 'exited with a non-zero rc') != []
# - non_zero_rc.module_rc == 2
# - non_zero_rc.module_stdout is defined
# - non_zero_rc.module_stderr is defined
- traceback is failed
- traceback.module_rc is not defined

Loading…
Cancel
Save