summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2015-09-21 12:31:14 -0700
committerToshio Kuratomi <toshio@fedoraproject.org>2015-09-21 12:31:51 -0700
commit627f9d73ba9c5734cade9e65a57a8aabac615696 (patch)
tree9c3fc4bf51025ee7a58e6cf4415679cf198a92c7
parentcc646c0a827729dd88ffcddcf4eb48ac4adb2e6d (diff)
downloadansible-warn-if-core-modules-not-present.tar.gz
Detect if core modules aren't installed and warn if that is the casewarn-if-core-modules-not-present
Fixes #11206
-rw-r--r--lib/ansible/parsing/mod_args.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/ansible/parsing/mod_args.py b/lib/ansible/parsing/mod_args.py
index a6ccaa0a56..ad4293013b 100644
--- a/lib/ansible/parsing/mod_args.py
+++ b/lib/ansible/parsing/mod_args.py
@@ -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 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:
templar = Templar(loader=None)
raw_params = args.pop('_raw_params')