Merge pull request #12457 from ansible/warn-if-core-modules-not-present
Detect if core modules aren't installed and warn if that is the case
This commit is contained in:
commit
53794b692c
1 changed files with 8 additions and 1 deletions
|
@ -275,7 +275,14 @@ class ModuleArgsParser:
|
||||||
|
|
||||||
# if we didn't see any module in the task at all, it's not a task really
|
# if we didn't see any module in the task at all, it's not a task really
|
||||||
if action is None:
|
if action is None:
|
||||||
raise AnsibleParserError("no action detected in task", obj=self._task_ds)
|
if 'ping' not in module_loader:
|
||||||
|
raise AnsibleParserError("The requested action was not found in configured module paths. "
|
||||||
|
"Additionally, core modules are missing. If this is a checkout, "
|
||||||
|
"run 'git submodule update --init --recursive' to correct this problem.",
|
||||||
|
obj=self._task_ds)
|
||||||
|
|
||||||
|
else:
|
||||||
|
raise AnsibleParserError("no action detected in task", obj=self._task_ds)
|
||||||
elif args.get('_raw_params', '') != '' and action not in RAW_PARAM_MODULES:
|
elif args.get('_raw_params', '') != '' and action not in RAW_PARAM_MODULES:
|
||||||
templar = Templar(loader=None)
|
templar = Templar(loader=None)
|
||||||
raw_params = args.pop('_raw_params')
|
raw_params = args.pop('_raw_params')
|
||||||
|
|
Loading…
Reference in a new issue