mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Add tests for undefined variable detection
Tests `test_playbook_undefined_varsX_fail` check if ansible detects undefined variables when `error_on_undefined_vars` is enabled. These tests fail without "Improve behavior with error_on_undefined_vars enabled" patch. Tests `test_playbook_undefined_varsX_ignore` check if ansible ignores undefined variables when `error_on_undefined_vars` is disabled. Also modify PlayBook._run_task_internal() so error_on_undefined_vars is testable.
This commit is contained in:
parent
fff4f1da33
commit
e3adfbf5f8
5 changed files with 67 additions and 1 deletions
|
@ -312,7 +312,8 @@ class PlayBook(object):
|
|||
conditional=task.only_if, callbacks=self.runner_callbacks,
|
||||
sudo=task.sudo, sudo_user=task.sudo_user,
|
||||
transport=task.transport, sudo_pass=task.sudo_pass, is_playbook=True,
|
||||
check=self.check, diff=self.diff, environment=task.environment, complex_args=task.args
|
||||
check=self.check, diff=self.diff, environment=task.environment, complex_args=task.args,
|
||||
error_on_undefined_vars=C.DEFAULT_UNDEFINED_VAR_BEHAVIOR
|
||||
)
|
||||
|
||||
if task.async_seconds == 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue