From 597c258e0e00f371d3af50915435dbd1524b8157 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 7 Dec 2018 14:47:56 -0500 Subject: [PATCH] explain 'bare variables' (#49577) --- changelogs/fragments/explain_bare.yml | 2 ++ lib/ansible/parsing/mod_args.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/explain_bare.yml diff --git a/changelogs/fragments/explain_bare.yml b/changelogs/fragments/explain_bare.yml new file mode 100644 index 00000000000..47ca7e1a567 --- /dev/null +++ b/changelogs/fragments/explain_bare.yml @@ -0,0 +1,2 @@ +bugfixes: + - explain 'bare variables' in error message diff --git a/lib/ansible/parsing/mod_args.py b/lib/ansible/parsing/mod_args.py index 456f8666fb9..7ef4e3f801e 100644 --- a/lib/ansible/parsing/mod_args.py +++ b/lib/ansible/parsing/mod_args.py @@ -145,8 +145,8 @@ class ModuleArgsParser: if templar._contains_vars(additional_args): final_args['_variable_params'] = additional_args else: - raise AnsibleParserError("Complex args containing variables cannot use bare variables, and must use the full variable style " - "('{{var_name}}')") + raise AnsibleParserError("Complex args containing variables cannot use bare variables (without Jinja2 delimiters), " + "and must use the full variable style ('{{var_name}}')") elif isinstance(additional_args, dict): final_args.update(additional_args) else: